[Libreoffice-commits] core.git: 2 commits - sd/qa sd/source sw/qa

2023-06-19 Thread Tomaž Vajngerl (via logerrit)
 sd/qa/unit/uiimpress.cxx |5 -
 sd/source/ui/func/fuconstr.cxx   |   36 

 sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx |binary
 sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx   |   43 
++
 4 files changed, 46 insertions(+), 38 deletions(-)

New commits:
commit 2afff27c5327bcb30f894d9a507131f2ad8f1dc6
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:28:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 13:36:37 2023 +0200

tdf#155086 remove code that sets theme color to shapes as DF

Remove this functionallity for now until we support theme colors
in shape styles. Then we can do it for the default style, and not
as a direct format for each inserted shape.

Change-Id: Ib042072954a79cadc750372333c40269fbe4ca40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153244
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index e3a9c86e91d1..c4cdc0a5e338 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -1144,7 +1144,8 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696)
 CPPUNIT_ASSERT(bContoured);
 }
 
-CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
+// TODO - Readd when we implement style level fill color and set that for 
default style
+/*CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert)
 {
 // Given a document with a theme, accent1 color is set to 0x04:
 createSdImpressDoc();
@@ -1188,7 +1189,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testThemeShapeInsert)
 // - Expected: 0 / 0x04 (~black)
 // - Actual  : 7512015 / 0x729fcf (~blue)
 CPPUNIT_ASSERT_EQUAL(static_cast(0x4), nFillColor);
-}
+}*/
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index 4db1f4042dc9..fd93a3ce7c94 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -371,42 +371,6 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, 
SdrObject* pObj,
 pObj->SetMergedItemSet(aAttr);
 }
 }
-else
-{
-// Creating an object with fill.
-SdrPage* pThemePage = pPage;
-if (pThemePage->TRG_HasMasterPage())
-{
-pThemePage = &pThemePage->TRG_GetMasterPage();
-}
-
-auto const& pTheme = pThemePage->getSdrPageProperties().GetTheme();
-if (pTheme)
-{
-// We construct an object on a page where the master page has 
a theme. Take the
-// accent1 color from that theme, make sure it has priority 
over the shape's
-// document-global style.
-SfxItemSet aAttr(mpView->GetDefaultAttr());
-
-aAttr.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
-
-model::ThemeColorType eColorType = 
model::ThemeColorType::Accent1;
-Color aColor = pTheme->GetColor(eColorType);
-XFillColorItem aFillColorItem("", aColor);
-aFillColorItem.getComplexColor().setSchemeColor(eColorType);
-aAttr.Put(aFillColorItem);
-
-aAttr.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
-
-// Line color is 50% darker than the fill color.
-aColor.ApplyTintOrShade(-5000);
-XLineColorItem aLineColorItem("", aColor);
-// TODO no theme or theme effect for line colors yet.
-aAttr.Put(aLineColorItem);
-
-pObj->SetMergedItemSet(aAttr);
-}
-}
 }
 }
 
commit 703c28d76924bcbda3f492de8a14cc9c30ee1dfb
Author: Tomaž Vajngerl 
AuthorDate: Mon Jun 19 15:48:56 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 19 13:36:28 2023 +0200

sw: Test paragraph level text background

Change-Id: Icea365ae036cae49749dd24bb8412775fafbd6c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153247
Tested-by: Tomaž Vajngerl 
Reviewed-by: Tomaž Vajngerl 

diff --git 
a/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx 
b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx
new file mode 100644
index ..5b012f01333b
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx 
b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
index f9e7155859ea..45bd8014f1d3 100644
--- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx
@@ -97,6 +97,49 @@ DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, 
"Test_CharUnderlineThemeC
 CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue);
 }
 
+DECLARE_SW_ROUNDTRIP_TEST(testP

[Libreoffice-commits] core.git: 2 commits - sd/qa sd/source sw/qa sw/source

2015-06-19 Thread Miklos Vajna
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |3 +++
 sd/source/ui/view/viewshel.cxx |6 ++
 sw/qa/extras/tiledrendering/tiledrendering.cxx |3 +++
 sw/source/uibase/uno/unotxdoc.cxx  |6 ++
 4 files changed, 18 insertions(+)

New commits:
commit abd92f37ee5840cc46bf26c4bfabc22ef5457ebe
Author: Miklos Vajna 
Date:   Fri Jun 19 16:14:59 2015 +0200

sd::ViewShell::GetTextSelection: fix text/richtext handling

Change-Id: If7d75d48667cd48d9426b02a38d2cf539b248d26

diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 6ec2219..55c4426 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -303,6 +303,9 @@ void SdTiledRenderingTest::testGetTextSelection()
 rEditView.SetSelection(aWordSelection);
 // Did we indeed manage to copy the selected text?
 CPPUNIT_ASSERT_EQUAL(OString("Shape"), 
pXImpressDocument->getTextSelection("text/plain;charset=utf-8"));
+
+// Make sure returned RTF is not empty.
+
CPPUNIT_ASSERT(!OString(pXImpressDocument->getTextSelection("text/richtext")).isEmpty());
 }
 
 void SdTiledRenderingTest::testSetGraphicSelection()
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index e3b8314..f8c45b5 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -597,6 +597,12 @@ OString ViewShell::GetTextSelection(const OString& 
_aMimeType)
 else
 aRet = OString(reinterpret_cast(aString.getStr()), aString.getLength() * sizeof(sal_Unicode));
 }
+else
+{
+uno::Sequence aSequence;
+aAny >>= aSequence;
+aRet = OString(reinterpret_cast(aSequence.getArray()), 
aSequence.getLength());
+}
 
 return aRet;
 }
commit e72e79dfa3342482214b37435550e534cfdfc08e
Author: Miklos Vajna 
Date:   Fri Jun 19 15:12:54 2015 +0200

SwXTextDocument::getTextSelection: fix missing non-string content handling

text/html works with this.

Change-Id: I749e0c987a87dbc6700956f564f6846617c393e8

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 1006ef9..8d9d6ae 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -233,6 +233,9 @@ void SwTiledRenderingTest::testGetTextSelection()
 // Make sure that we selected text from the body text.
 CPPUNIT_ASSERT_EQUAL(OString("Hello"), 
pXTextDocument->getTextSelection("text/plain;charset=utf-8"));
 
+// Make sure we produce something for HTML.
+
CPPUNIT_ASSERT(!OString(pXTextDocument->getTextSelection("text/html")).isEmpty());
+
 // Now select some shape text and check again.
 SdrPage* pPage = 
pWrtShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
 SdrObject* pObject = pPage->GetObj(0);
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 9c9f15f..e2008ac 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3310,6 +3310,12 @@ OString SwXTextDocument::getTextSelection(const char* 
pMimeType)
 else
 aRet = OString(reinterpret_cast(aString.getStr()), aString.getLength() * sizeof(sal_Unicode));
 }
+else
+{
+uno::Sequence aSequence;
+aAny >>= aSequence;
+aRet = OString(reinterpret_cast(aSequence.getArray()), 
aSequence.getLength());
+}
 
 return aRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits