[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sw/qa sw/source writerfilter/source

Szymon Kłos szymon.klos at collabora.com
Tue Sep 12 19:16:47 UTC 2017


 dev/null                                          |binary
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx         |   14 --------------
 sw/source/core/edit/edfcol.cxx                    |   15 +++++----------
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   10 +---------
 4 files changed, 6 insertions(+), 33 deletions(-)

New commits:
commit 348bc3c6a8142ed605e260ae930d76e6cec7f656
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Mon Sep 11 10:53:47 2017 +0200

    tdf#112304 Revert "Watermark: not visible if page background was set"
    
    This reverts commit 39c08074a286855dd014ce1c30b8f7ef95b10242.
    Fixed by: I69517efb7d82acd719d6a27a09ba61554dbf1ec9
    
    Change-Id: Icd45b3f55292670ff7338a367eba212453a0687e
    Reviewed-on: https://gerrit.libreoffice.org/42155
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/42165
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sw/qa/extras/ooxmlexport/data/watermark-layer.docx b/sw/qa/extras/ooxmlexport/data/watermark-layer.docx
deleted file mode 100755
index 9428686c1bad..000000000000
Binary files a/sw/qa/extras/ooxmlexport/data/watermark-layer.docx and /dev/null differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 55f6e3ab3481..55f74de73635 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -28,10 +28,8 @@
 #include <com/sun/star/text/TextContentAnchorType.hpp>
 
 #include <ftninfo.hxx>
-#include <drawdoc.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/docfilt.hxx>
-#include <svx/svdpage.hxx>
 
 class Test : public SwModelTestBase
 {
@@ -558,18 +556,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xff0000), getProperty<sal_Int32>(xCell3, "BackColor"));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testWatermarkLayer, "watermark-layer.docx")
-{
-    // Watermark was not visible if page background was set.
-
-    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
-    SdrPage* pPage = pTextDoc->GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
-    SdrObject* pObject = pPage->GetObj(0);
-
-    CPPUNIT_ASSERT(pObject);
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(1), pObject->GetLayer());
-}
-
 DECLARE_OOXMLEXPORT_TEST(tdf112169, "tdf112169.odt")
 {
     // LO crashed while export because of chararacter background color handling
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 1dadb1bdb8f4..06a33461430f 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -59,7 +59,6 @@
 #include <rootfrm.hxx>
 #include <pagefrm.hxx>
 #include <sfx2/watermarkitem.hxx>
-#include <DocumentDrawModelManager.hxx>
 
 #define WATERMARK_NAME "PowerPlusWaterMarkObject"
 
@@ -348,8 +347,7 @@ SfxWatermarkItem SwEditShell::GetWatermark()
 void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark,
                             const uno::Reference<frame::XModel>& xModel,
                             const uno::Reference<beans::XPropertySet>& xPageStyle,
-                            const uno::Reference<text::XText>& xHeaderText,
-                            sal_Int16 nLayer)
+                            const uno::Reference<text::XText>& xHeaderText)
 {
     uno::Reference<lang::XMultiServiceFactory> xMultiServiceFactory(xModel, uno::UNO_QUERY);
     OUString aShapeServiceName = "com.sun.star.drawing.CustomShape";
@@ -471,7 +469,6 @@ void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark,
         xPropertySet->setPropertyValue("Transformation", uno::makeAny(aMatrix));
         xPropertySet->setPropertyValue(UNO_NAME_HORI_ORIENT, uno::makeAny(static_cast<sal_Int16>(text::HoriOrientation::CENTER)));
         xPropertySet->setPropertyValue(UNO_NAME_VERT_ORIENT, uno::makeAny(static_cast<sal_Int16>(text::VertOrientation::CENTER)));
-        xPropertySet->setPropertyValue(UNO_NAME_MISC_OBJ_LAYERID, uno::makeAny(nLayer));
 
         uno::Reference<text::XTextRange> xTextRange(xShape, uno::UNO_QUERY);
         xTextRange->setString(rWatermark.GetText());
@@ -517,8 +514,6 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark)
     uno::Reference<container::XNameAccess> xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
     uno::Reference<container::XNameAccess> xStyleFamily(xStyleFamilies->getByName("PageStyles"), uno::UNO_QUERY);
 
-    sal_Int16 nHeavenId = GetDoc()->getIDocumentDrawModelAccess().GetHeavenId();
-
     std::set<OUString> aUsedPageStyles = lcl_getUsedPageStyles(this);
     for (const OUString& rPageStyleName : aUsedPageStyles)
     {
@@ -544,16 +539,16 @@ void SwEditShell::SetWatermark(const SfxWatermarkItem& rWatermark)
         uno::Reference<text::XText> xHeaderTextRight;
 
         xPageStyle->getPropertyValue(UNO_NAME_HEADER_TEXT) >>= xHeaderText;
-        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderText, nHeavenId);
+        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderText);
 
         xPageStyle->getPropertyValue(UNO_NAME_HEADER_TEXT_FIRST) >>= xHeaderTextFirst;
-        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextFirst, nHeavenId);
+        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextFirst);
 
         xPageStyle->getPropertyValue(UNO_NAME_HEADER_TEXT_LEFT) >>= xHeaderTextLeft;
-        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextLeft, nHeavenId);
+        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextLeft);
 
         xPageStyle->getPropertyValue(UNO_NAME_HEADER_TEXT_RIGHT) >>= xHeaderTextRight;
-        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextRight, nHeavenId);
+        lcl_placeWatermarkInHeader(rWatermark, xModel, xPageStyle, xHeaderTextRight);
 
         // tdf#108494 the header height was switched to height of a watermark
         // and shape was moved to the lower part of a page
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 34b9f6b1601f..25751c12be4e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -85,7 +85,7 @@
 #include <comphelper/sequence.hxx>
 #include <comphelper/propertyvalue.hxx>
 #include <unotools/mediadescriptor.hxx>
-#include <editeng/unoprnms.hxx>
+
 
 
 
@@ -2138,14 +2138,6 @@ void DomainMapper_Impl::PopShapeContext()
             {
             }
         }
-        // Move Watermark upper to be visible if page background is set
-        uno::Reference<drawing::XShape> xShape( xObj, uno::UNO_QUERY_THROW );
-        uno::Reference<container::XNamed> xNamed( xShape, uno::UNO_QUERY );
-        if ( xNamed.is() && xNamed->getName().match( "PowerPlusWaterMarkObject" ) )
-        {
-            uno::Reference<beans::XPropertySet> xShapePropertySet( xShape, uno::UNO_QUERY );
-            xShapePropertySet->setPropertyValue( UNO_NAME_MISC_OBJ_LAYERID, uno::makeAny( sal_Int16(1) ) );
-        }
         m_aAnchoredStack.pop();
     }
     m_bFrameBtLr = false;


More information about the Libreoffice-commits mailing list