[Libreoffice-commits] core.git: 4 commits - include/svtools oox/source sc/source svgio/inc svgio/source svtools/source sw/source

Zhe Wang wangzcdl at apache.org
Thu Jun 13 13:00:59 PDT 2013


 include/svtools/optionsdrawinglayer.hxx                 |    5 
 oox/source/drawingml/textparagraphpropertiescontext.cxx |    4 
 sc/source/ui/view/gridwin.cxx                           |   20 --
 svgio/inc/svgio/svgreader/svgnode.hxx                   |   30 ++++
 svgio/inc/svgio/svgreader/svgstyleattributes.hxx        |   22 +--
 svgio/inc/svgio/svgreader/svgtoken.hxx                  |    1 
 svgio/source/svgreader/svgclippathnode.cxx              |    2 
 svgio/source/svgreader/svgimagenode.cxx                 |    2 
 svgio/source/svgreader/svgmarkernode.cxx                |    2 
 svgio/source/svgreader/svgmasknode.cxx                  |    2 
 svgio/source/svgreader/svgnode.cxx                      |  109 +++++++++++++++-
 svgio/source/svgreader/svgpatternnode.cxx               |    2 
 svgio/source/svgreader/svgstyleattributes.cxx           |   43 +++---
 svgio/source/svgreader/svgtoken.cxx                     |    2 
 svgio/source/svgreader/svgusenode.cxx                   |    2 
 svgio/source/svguno/xsvgparser.cxx                      |    7 -
 svtools/source/config/optionsdrawinglayer.cxx           |   21 +++
 sw/source/core/crsr/viscrs.cxx                          |   21 ---
 sw/source/core/doc/notxtfrm.cxx                         |   36 +++++
 19 files changed, 253 insertions(+), 80 deletions(-)

New commits:
commit 1ff3ab9235e32305c820af75b9677334c81d9899
Author: Zhe Wang <wangzcdl at apache.org>
Date:   Fri Sep 7 03:45:35 2012 +0000

    Resolves: #i119579# position & direction of bracket incorrect in Arabic locale
    
    * subversion/main/oox/source/drawingml/textparagraphpropertiescontext.cxx
    []WritingMode2 is used to numerous explicit writing directions, so use WritingMode2 to instead WritingMode.
    
    Patch by: Ma Bingbing <jiazema at gmail.com>
    Suggested by: Wang Zhe <kingwisemmx at gmai.com>
    Found by: Wang Lifeng <phoenix.wanglf at gmail.com>
    Review by: Wang Zhe <kingwisemmx at gmai.com>(cherry picked from commit 4545d293b1cf5009b075cdc82d43916909b77347)
    
    Change-Id: Ic621ce6107bdc0b83c511f055175ae7b629f1503

diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx
index d674b81..6b5f29a 100644
--- a/oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -19,7 +19,7 @@
 
 #include "oox/drawingml/textparagraphpropertiescontext.hxx"
 
-#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/awt/FontDescriptor.hpp>
 
 #include "oox/drawingml/colorchoicecontext.hxx"
@@ -122,7 +122,7 @@ TextParagraphPropertiesContext::TextParagraphPropertiesContext( ContextHandler&
     if ( xAttribs->hasAttribute( XML_rtl ) )
     {
         bool bRtl = attribs.getBool( XML_rtl, false );
-        rPropertyMap[ PROP_TextWritingMode ] <<= ( bRtl ? WritingMode_RL_TB : WritingMode_LR_TB );
+        rPropertyMap[ PROP_WritingMode ] <<= ( bRtl ? WritingMode2::RL_TB : WritingMode2::LR_TB );
     }
 }
 
commit 721255a3c07a513c8ddecd01eba2531d8d612459
Author: Armin Le Grand <alg at apache.org>
Date:   Thu Apr 11 13:09:19 2013 +0000

    Resolves: #i122039# Take GraphicAttr into account for...
    
    SVGs in Writer GraphicObjects
    
    (cherry picked from commit 436b901a3b195a7e5089d1a03a46ed9442239610)
    
    Conflicts:
    	sw/source/core/doc/notxtfrm.cxx
    
    Change-Id: I0e1d4087c94f7d73f1b124ea7918f051c9eacd12

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 5da0fb2..88eeedb 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -72,6 +72,7 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 
 using namespace com::sun::star;
@@ -917,10 +918,43 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
                             aAlignedGrfArea.Left(), aAlignedGrfArea.Top(),
                             aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom());
                         const bool bCropped(aGrfAttr.IsCropped());
+                        drawinglayer::primitive2d::Primitive2DSequence aContent;
+                        GraphicAttr aSuppressGraphicAttr(aGrfAttr);
+
+                        aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
+                        aSuppressGraphicAttr.SetRotation(0);
+                        aSuppressGraphicAttr.SetMirrorFlags(0);
+
+                        const bool bNeedTransformedGraphic(
+                            aSuppressGraphicAttr.IsSpecialDrawMode() ||
+                            aSuppressGraphicAttr.IsAdjusted() ||
+                            aSuppressGraphicAttr.IsMirrored() ||
+                            aSuppressGraphicAttr.IsRotated() ||
+                            aSuppressGraphicAttr.IsTransparent());
+
+                        if(bNeedTransformedGraphic)
+                        {
+                            // #i122039# need to apply graphic transformation if GraphicAttr are used qwhich need this
+                            const Graphic aTransformedGraphic(rGrfObj.GetTransformedGraphic(&aSuppressGraphicAttr));
+                            const basegfx::B2DRange aRange(rSvgDataPtr->getRange());
+                            const basegfx::B2DHomMatrix aTransform(
+                                basegfx::tools::createScaleTranslateB2DHomMatrix(
+                                    aRange.getRange(),
+                                    aRange.getMinimum()));
+
+                            aContent.realloc(1);
+                            aContent[0] = new drawinglayer::primitive2d::BitmapPrimitive2D(
+                                aTransformedGraphic.GetBitmapEx(),
+                                aTransform);
+                        }
+                        else
+                        {
+                            aContent = rSvgDataPtr->getPrimitive2DSequence();
+                        }
 
                         bDone = paintUsingPrimitivesHelper(
                             *pOut,
-                            rSvgDataPtr->getPrimitive2DSequence(),
+                            aContent,
                             rSvgDataPtr->getRange(),
                             aTargetRange,
                             bCropped ? aGrfAttr.GetLeftCrop() : 0,
commit 6c9b376b2dc9007f1cb48a189f3020a1b82937fd
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Jan 23 16:06:22 2013 +0000

    Resolves: #i121532# unified getting the blended selection color
    
    (cherry picked from commit dd4bed5d1151db2a45dbbfe9eff61875f8f4835d)
    
    Conflicts:
    	svtools/inc/svtools/optionsdrawinglayer.hxx
    	svtools/source/config/optionsdrawinglayer.cxx
    	sw/source/core/crsr/viscrs.cxx
    
    Change-Id: I21167b58a9b81f5fa15c7def5fb4b6023f91f32b

diff --git a/include/svtools/optionsdrawinglayer.hxx b/include/svtools/optionsdrawinglayer.hxx
index f2d493b..b51b086 100644
--- a/include/svtools/optionsdrawinglayer.hxx
+++ b/include/svtools/optionsdrawinglayer.hxx
@@ -151,6 +151,11 @@ class SVT_DLLPUBLIC SvtOptionsDrawinglayer
         sal_uInt16  GetTransparentSelectionPercent() const;
         sal_uInt16  GetSelectionMaximumLuminancePercent() const;
 
+        // get system hilight color, limited to the maximum allowed luminance
+        // (defined in GetSelectionMaximumLuminancePercent() in SvtOptionsDrawinglayer,
+        // combined with Application::GetSettings().GetStyleSettings().GetHighlightColor())
+        Color getHilightColor() const;
+
         void        SetTransparentSelection( sal_Bool bState );
         void        SetTransparentSelectionPercent( sal_uInt16 nPercent );
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 4a5c9b5..244a731 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5542,25 +5542,9 @@ void ScGridWindow::UpdateSelectionOverlay()
                 aRanges.push_back(aRB);
             }
 
-            // #i97672# get the system's hilight color and limit it to the maximum
-            // allowed luminance. This is needed to react on too bright hilight colors
-            // which would otherwise vive a bad visualisation
-            Color aHighlight(GetSettings().GetStyleSettings().GetHighlightColor());
+            // get the system's hilight color
             const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
-            const basegfx::BColor aSelection(aHighlight.getBColor());
-            const double fLuminance(aSelection.luminance());
-            const double fMaxLum(aSvtOptionsDrawinglayer.GetSelectionMaximumLuminancePercent() / 100.0);
-
-            if(fLuminance > fMaxLum)
-            {
-                const double fFactor(fMaxLum / fLuminance);
-                const basegfx::BColor aNewSelection(
-                    aSelection.getRed() * fFactor,
-                    aSelection.getGreen() * fFactor,
-                    aSelection.getBlue() * fFactor);
-
-                aHighlight = Color(aNewSelection);
-            }
+            const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
 
             sdr::overlay::OverlayObject* pOverlay = new sdr::overlay::OverlaySelection(
                 sdr::overlay::OVERLAY_TRANSPARENT,
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx
index 025a2bc..31a84c2 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -1229,6 +1229,27 @@ sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
     return aRetval;
 }
 
+Color SvtOptionsDrawinglayer::getHilightColor() const
+{
+    Color aRetval(Application::GetSettings().GetStyleSettings().GetHighlightColor());
+    const basegfx::BColor aSelection(aRetval.getBColor());
+    const double fLuminance(aSelection.luminance());
+    const double fMaxLum(GetSelectionMaximumLuminancePercent() / 100.0);
+
+    if(fLuminance > fMaxLum)
+    {
+        const double fFactor(fMaxLum / fLuminance);
+        const basegfx::BColor aNewSelection(
+            aSelection.getRed() * fFactor,
+            aSelection.getGreen() * fFactor,
+            aSelection.getBlue() * fFactor);
+
+        aRetval = Color(aNewSelection);
+    }
+
+    return aRetval;
+}
+
 namespace
 {
     class theOptionsDrawinglayerMutex : public rtl::Static<osl::Mutex, theOptionsDrawinglayerMutex>{};
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 7c2d1de..dc52c9b 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -266,26 +266,9 @@ void SwSelPaintRects::Show()
 
             if (xTargetOverlay.is())
             {
-                // #i97672# get the system's highlight color and limit it to the
-                // maximum allowed luminance. This is needed to react on too bright
-                // highlight colors which would otherwise vive a bad visualisation.
-                const OutputDevice *pOut = Application::GetDefaultDevice();
-                Color aHighlight(pOut->GetSettings().GetStyleSettings().GetHighlightColor());
+                // get the system's hilight color
                 const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
-                const basegfx::BColor aSelection(aHighlight.getBColor());
-                const double fLuminance(aSelection.luminance());
-                const double fMaxLum(aSvtOptionsDrawinglayer.GetSelectionMaximumLuminancePercent() / 100.0);
-
-                if(fLuminance > fMaxLum)
-                {
-                    const double fFactor(fMaxLum / fLuminance);
-                    const basegfx::BColor aNewSelection(
-                        aSelection.getRed() * fFactor,
-                        aSelection.getGreen() * fFactor,
-                        aSelection.getBlue() * fFactor);
-
-                    aHighlight = Color(aNewSelection);
-                }
+                const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
 
                 // create correct selection
                 mpCursorOverlay = new sdr::overlay::OverlaySelection(
commit 0061af795047deb92c4b43ec191ad6ffd97d0b64
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Jan 23 09:27:24 2013 +0000

    Resolves: #i121656# Some more cleanups for SVG import
    
    also const as const can
    (cherry picked from commit bb9ad24b16add4888c4b1fadac5252b95a72f04f)
    
    Conflicts:
    	svgio/inc/svgio/svgreader/svgstyleattributes.hxx
    	svgio/source/svgreader/svgstyleattributes.cxx
    	svgio/source/svgreader/svgtoken.cxx
    
    Change-Id: If236eb8b1e0193c43229ea6dc496eb3a8fd20c42
    
    Related: #i121656# removed const for return-by-value
    
    (cherry picked from commit aa85e31b3162cd4b18c818bf0af1a854cb05c57d)
    
    Conflicts:
    	svgio/inc/svgio/svgreader/svgstyleattributes.hxx
    	svgio/source/svgreader/svgstyleattributes.cxx
    
    Change-Id: Ief43c478ea3000d114487918875e9a201dd827bc

diff --git a/svgio/inc/svgio/svgreader/svgnode.hxx b/svgio/inc/svgio/svgreader/svgnode.hxx
index 759859b..2aa2816 100644
--- a/svgio/inc/svgio/svgreader/svgnode.hxx
+++ b/svgio/inc/svgio/svgreader/svgnode.hxx
@@ -56,6 +56,29 @@ namespace svgio
             XmlSpace_preserve
         };
 
+        // display property (see SVG 1.1. 11.5), not inheritable
+        enum Display // #i121656#
+        {
+            Display_inline, // the default
+            Display_block,
+            Display_list_item,
+            Display_run_in,
+            Display_compact,
+            Display_marker,
+            Display_table,
+            Display_inline_table,
+            Display_table_row_group,
+            Display_table_header_group,
+            Display_table_footer_group,
+            Display_table_row,
+            Display_table_column_group,
+            Display_table_column,
+            Display_table_cell,
+            Display_table_caption,
+            Display_none,
+            Display_inherit
+        };
+
         class SvgNode : private boost::noncopyable, public InfoProvider
         {
         private:
@@ -77,6 +100,9 @@ namespace svgio
             /// XmlSpace value
             XmlSpace                    maXmlSpace;
 
+            /// Display value #i121656#
+            Display                     maDisplay;
+
             /// CSS styles
             SvgStyleAttributeVector     maCssStyleVector;
 
@@ -119,6 +145,10 @@ namespace svgio
             XmlSpace getXmlSpace() const;
             void setXmlSpace(XmlSpace eXmlSpace = XmlSpace_notset) { maXmlSpace = eXmlSpace; }
 
+            /// Display access #i121656#
+            Display getDisplay() const { return maDisplay; }
+            void setDisplay(Display eDisplay = Display_inherit) { maDisplay = eDisplay; }
+
             /// alternative parent
             void setAlternativeParent(const SvgNode* pAlternativeParent = 0) { mpAlternativeParent = pAlternativeParent; }
         };
diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index fe290ae..a84fd46 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -287,11 +287,11 @@ namespace svgio
             void setStopColor(const SvgPaint& rStopColor) { maStopColor = rStopColor; }
 
             /// stroke-width content
-            const SvgNumber getStrokeWidth() const;
+            SvgNumber getStrokeWidth() const;
             void setStrokeWidth(const SvgNumber& rStrokeWidth = SvgNumber()) { maStrokeWidth = rStrokeWidth; }
 
             /// stop opacity content
-            const SvgNumber getStopOpacity() const;
+            SvgNumber getStopOpacity() const;
             void setStopOpacity(const SvgNumber& rStopOpacity = SvgNumber()) { maStopOpacity = rStopOpacity; }
 
             /// access to evtl. set fill gradient
@@ -311,7 +311,7 @@ namespace svgio
             void setSvgPatternNodeStroke(const SvgPatternNode* pNew) { mpSvgPatternNodeStroke = pNew; }
 
             /// fill opacity content
-            const SvgNumber getFillOpacity() const;
+            SvgNumber getFillOpacity() const;
             void setFillOpacity(const SvgNumber& rFillOpacity = SvgNumber()) { maFillOpacity = rFillOpacity; }
 
             /// fill rule content
@@ -327,7 +327,7 @@ namespace svgio
             void setStrokeDasharraySet(bool bNew) { mbStrokeDasharraySet = bNew; }
 
             /// StrokeDashOffset content
-            const SvgNumber getStrokeDashOffset() const;
+            SvgNumber getStrokeDashOffset() const;
             void setStrokeDashOffset(const SvgNumber& rStrokeDashOffset = SvgNumber()) { maStrokeDashOffset = rStrokeDashOffset; }
 
             /// StrokeLinecap content
@@ -339,11 +339,11 @@ namespace svgio
             void setStrokeLinejoin(const StrokeLinejoin aStrokeLinejoin = StrokeLinejoin_notset) { maStrokeLinejoin = aStrokeLinejoin; }
 
             /// StrokeMiterLimit content
-            const SvgNumber getStrokeMiterLimit() const;
+            SvgNumber getStrokeMiterLimit() const;
             void setStrokeMiterLimit(const SvgNumber& rStrokeMiterLimit = SvgNumber()) { maStrokeMiterLimit = rStrokeMiterLimit; }
 
             /// StrokeOpacity content
-            const SvgNumber getStrokeOpacity() const;
+            SvgNumber getStrokeOpacity() const;
             void setStrokeOpacity(const SvgNumber& rStrokeOpacity = SvgNumber()) { maStrokeOpacity = rStrokeOpacity; }
 
             /// Font content
@@ -351,7 +351,7 @@ namespace svgio
             void setFontFamily(const SvgStringVector& rSvgStringVector = SvgStringVector()) { maFontFamily = rSvgStringVector; }
 
             /// FontSize content
-            const SvgNumber getFontSize() const;
+            SvgNumber getFontSize() const;
             void setFontSize(const SvgNumber& rFontSize = SvgNumber()) { maFontSize = rFontSize; }
 
             /// FontStretch content
@@ -388,7 +388,7 @@ namespace svgio
             void setColor(const SvgPaint& rColor) { maColor = rColor; }
 
             /// Opacity content
-            const SvgNumber getOpacity() const { return maOpacity; }
+            SvgNumber getOpacity() const { return maOpacity; }
             void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { maOpacity = rOpacity; }
 
             // Title content
@@ -408,17 +408,17 @@ namespace svgio
             void setMaskXLink(const OUString& rNew) { maMaskXLink = rNew; }
 
             // MarkerStartXLink content
-            const OUString getMarkerStartXLink() const;
+            OUString getMarkerStartXLink() const;
             const SvgMarkerNode* accessMarkerStartXLink() const;
             void setMarkerStartXLink(const OUString& rNew) { maMarkerStartXLink = rNew; }
 
             // MarkerMidXLink content
-            const OUString getMarkerMidXLink() const;
+            OUString getMarkerMidXLink() const;
             const SvgMarkerNode* accessMarkerMidXLink() const;
             void setMarkerMidXLink(const OUString& rNew) { maMarkerMidXLink = rNew; }
 
             // MarkerEndXLink content
-            const OUString getMarkerEndXLink() const;
+            OUString getMarkerEndXLink() const;
             const SvgMarkerNode* accessMarkerEndXLink() const;
             void setMarkerEndXLink(const OUString& rNew) { maMarkerEndXLink = rNew; }
 
diff --git a/svgio/inc/svgio/svgreader/svgtoken.hxx b/svgio/inc/svgio/svgreader/svgtoken.hxx
index 9e81c9d..2e1f8c4 100644
--- a/svgio/inc/svgio/svgreader/svgtoken.hxx
+++ b/svgio/inc/svgio/svgreader/svgtoken.hxx
@@ -40,6 +40,7 @@ namespace svgio
             SVGTokenViewBox,
             SVGTokenTransform,
             SVGTokenStyle,
+            SVGTokenDisplay, // #i121656#
             SVGTokenD,
             SVGTokenX,
             SVGTokenY,
diff --git a/svgio/source/svgreader/svgclippathnode.cxx b/svgio/source/svgreader/svgclippathnode.cxx
index 16a126e..f536f5e 100644
--- a/svgio/source/svgreader/svgclippathnode.cxx
+++ b/svgio/source/svgreader/svgclippathnode.cxx
@@ -128,7 +128,7 @@ namespace svgio
 
         void SvgClipPathNode::apply(drawinglayer::primitive2d::Primitive2DSequence& rContent) const
         {
-            if(rContent.hasElements())
+            if(rContent.hasElements() && Display_none != getDisplay())
             {
                 const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
                 drawinglayer::primitive2d::Primitive2DSequence aClipTarget;
diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx
index 7c7de6b..31788f5 100644
--- a/svgio/source/svgreader/svgimagenode.cxx
+++ b/svgio/source/svgreader/svgimagenode.cxx
@@ -255,7 +255,7 @@ namespace svgio
                     {
                         const SvgNode* mpXLink = getDocument().findSvgNodeById(maXLink);
 
-                        if(mpXLink)
+                        if(mpXLink && Display_none != mpXLink->getDisplay())
                         {
                             mpXLink->decomposeSvgNode(aNewTarget, true);
 
diff --git a/svgio/source/svgreader/svgmarkernode.cxx b/svgio/source/svgreader/svgmarkernode.cxx
index e79b0f0..fdbb8bd 100644
--- a/svgio/source/svgreader/svgmarkernode.cxx
+++ b/svgio/source/svgreader/svgmarkernode.cxx
@@ -182,7 +182,7 @@ namespace svgio
 
         const drawinglayer::primitive2d::Primitive2DSequence& SvgMarkerNode::getMarkerPrimitives() const
         {
-            if(!aPrimitives.hasElements())
+            if(!aPrimitives.hasElements() && Display_none != getDisplay())
             {
                 decomposeSvgNode(const_cast< SvgMarkerNode* >(this)->aPrimitives, true);
             }
diff --git a/svgio/source/svgreader/svgmasknode.cxx b/svgio/source/svgreader/svgmasknode.cxx
index 831cf39..d0f3f29 100644
--- a/svgio/source/svgreader/svgmasknode.cxx
+++ b/svgio/source/svgreader/svgmasknode.cxx
@@ -194,7 +194,7 @@ namespace svgio
 
         void SvgMaskNode::apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget) const
         {
-            if(rTarget.hasElements())
+            if(rTarget.hasElements() && Display_none != getDisplay())
             {
                 drawinglayer::primitive2d::Primitive2DSequence aMaskTarget;
 
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx
index ff44050..8e95546 100644
--- a/svgio/source/svgreader/svgnode.cxx
+++ b/svgio/source/svgreader/svgnode.cxx
@@ -144,6 +144,7 @@ namespace svgio
             mpId(0),
             mpClass(0),
             maXmlSpace(XmlSpace_notset),
+            maDisplay(Display_inline),
             maCssStyleVector()
         {
             OSL_ENSURE(SVGTokenUnknown != maType, "SvgNode with unknown type created (!)");
@@ -225,6 +226,104 @@ namespace svgio
                     }
                     break;
                 }
+                case SVGTokenDisplay:
+                {
+                    if(aContent.getLength())
+                    {
+                        static rtl::OUString aStrInline(rtl::OUString::createFromAscii("inline"));
+                        static rtl::OUString aStrBlock(rtl::OUString::createFromAscii("block"));
+                        static rtl::OUString aStrList_item(rtl::OUString::createFromAscii("list-item"));
+                        static rtl::OUString aStrRun_in(rtl::OUString::createFromAscii("run-in"));
+                        static rtl::OUString aStrCompact(rtl::OUString::createFromAscii("compact"));
+                        static rtl::OUString aStrMarker(rtl::OUString::createFromAscii("marker"));
+                        static rtl::OUString aStrTable(rtl::OUString::createFromAscii("table"));
+                        static rtl::OUString aStrInline_table(rtl::OUString::createFromAscii("inline-table"));
+                        static rtl::OUString aStrTable_row_group(rtl::OUString::createFromAscii("table-row-group"));
+                        static rtl::OUString aStrTable_header_group(rtl::OUString::createFromAscii("table-header-group"));
+                        static rtl::OUString aStrTable_footer_group(rtl::OUString::createFromAscii("table-footer-group"));
+                        static rtl::OUString aStrTable_row(rtl::OUString::createFromAscii("table-row"));
+                        static rtl::OUString aStrTable_column_group(rtl::OUString::createFromAscii("table-column-group"));
+                        static rtl::OUString aStrTable_column(rtl::OUString::createFromAscii("table-column"));
+                        static rtl::OUString aStrTable_cell(rtl::OUString::createFromAscii("table-cell"));
+                        static rtl::OUString aStrTable_caption(rtl::OUString::createFromAscii("table-caption"));
+                        static rtl::OUString aStrNone(rtl::OUString::createFromAscii("none"));
+                        static rtl::OUString aStrInherit(rtl::OUString::createFromAscii("inherit"));
+
+                        if(aContent.match(aStrInline))
+                        {
+                            setDisplay(Display_inline);
+                        }
+                        else if(aContent.match(aStrNone))
+                        {
+                            setDisplay(Display_none);
+                        }
+                        else if(aContent.match(aStrInherit))
+                        {
+                            setDisplay(Display_inherit);
+                        }
+                        else if(aContent.match(aStrBlock))
+                        {
+                            setDisplay(Display_block);
+                        }
+                        else if(aContent.match(aStrList_item))
+                        {
+                            setDisplay(Display_list_item);
+                        }
+                        else if(aContent.match(aStrRun_in))
+                        {
+                            setDisplay(Display_run_in);
+                        }
+                        else if(aContent.match(aStrCompact))
+                        {
+                            setDisplay(Display_compact);
+                        }
+                        else if(aContent.match(aStrMarker))
+                        {
+                            setDisplay(Display_marker);
+                        }
+                        else if(aContent.match(aStrTable))
+                        {
+                            setDisplay(Display_table);
+                        }
+                        else if(aContent.match(aStrInline_table))
+                        {
+                            setDisplay(Display_inline_table);
+                        }
+                        else if(aContent.match(aStrTable_row_group))
+                        {
+                            setDisplay(Display_table_row_group);
+                        }
+                        else if(aContent.match(aStrTable_header_group))
+                        {
+                            setDisplay(Display_table_header_group);
+                        }
+                        else if(aContent.match(aStrTable_footer_group))
+                        {
+                            setDisplay(Display_table_footer_group);
+                        }
+                        else if(aContent.match(aStrTable_row))
+                        {
+                            setDisplay(Display_table_row);
+                        }
+                        else if(aContent.match(aStrTable_column_group))
+                        {
+                            setDisplay(Display_table_column_group);
+                        }
+                        else if(aContent.match(aStrTable_column))
+                        {
+                            setDisplay(Display_table_column);
+                        }
+                        else if(aContent.match(aStrTable_cell))
+                        {
+                            setDisplay(Display_table_cell);
+                        }
+                        else if(aContent.match(aStrTable_caption))
+                        {
+                            setDisplay(Display_table_caption);
+                        }
+                    }
+                    break;
+                }
                 default:
                 {
                     break;
@@ -234,6 +333,11 @@ namespace svgio
 
         void SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
         {
+            if(Display_none == getDisplay())
+            {
+                return;
+            }
+
             if(!bReferenced)
             {
                 if(SVGTokenDefs == getType() ||
@@ -253,6 +357,9 @@ namespace svgio
 
                     // also not directly used are Markers and Patterns, only indirecty used
                     // by reference
+
+                    // #i121656# also do not decompose nodes which have display="none" set
+                    // as property
                     return;
                 }
             }
@@ -267,7 +374,7 @@ namespace svgio
                 {
                     SvgNode* pCandidate = rChildren[a];
 
-                    if(pCandidate)
+                    if(pCandidate && Display_none != pCandidate->getDisplay())
                     {
                         drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
 
diff --git a/svgio/source/svgreader/svgpatternnode.cxx b/svgio/source/svgreader/svgpatternnode.cxx
index 229a7c6..522f024 100644
--- a/svgio/source/svgreader/svgpatternnode.cxx
+++ b/svgio/source/svgreader/svgpatternnode.cxx
@@ -269,7 +269,7 @@ namespace svgio
 
         const drawinglayer::primitive2d::Primitive2DSequence& SvgPatternNode::getPatternPrimitives() const
         {
-            if(!aPrimitives.hasElements())
+            if(!aPrimitives.hasElements() && Display_none != getDisplay())
             {
                 decomposeSvgNode(const_cast< SvgPatternNode* >(this)->aPrimitives, true);
             }
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 140107f..7b8a8a5 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1070,6 +1070,18 @@ namespace svgio
                     aSource = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
                 }
 
+                if(pTransform)
+                {
+                    // create embedding group element with transformation. This applies the given
+                    // transformation to the graphical content, but *not* to mask and/or clip (as needed)
+                    const drawinglayer::primitive2d::Primitive2DReference xRef(
+                        new drawinglayer::primitive2d::TransformPrimitive2D(
+                            *pTransform,
+                            aSource));
+
+                    aSource = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+                }
+
                 if(getClipPathXLink().getLength())
                 {
                     // try to access linked ClipPath
@@ -1096,17 +1108,6 @@ namespace svgio
 
                     if(aSource.hasElements()) // test again, applied mask may have lead to empty geometry
                     {
-                        if(pTransform)
-                        {
-                            // create embedding group element with transformation
-                            const drawinglayer::primitive2d::Primitive2DReference xRef(
-                                new drawinglayer::primitive2d::TransformPrimitive2D(
-                                    *pTransform,
-                                    aSource));
-
-                            aSource = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
-                        }
-
                         // append to current target
                         drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aSource);
                     }
@@ -1951,7 +1952,7 @@ namespace svgio
             return 0;
         }
 
-        const SvgNumber SvgStyleAttributes::getStrokeWidth() const
+        SvgNumber SvgStyleAttributes::getStrokeWidth() const
         {
             if(mbIsClipPathContent)
             {
@@ -1973,7 +1974,7 @@ namespace svgio
             return SvgNumber(1.0);
         }
 
-        const SvgNumber SvgStyleAttributes::getStopOpacity() const
+        SvgNumber SvgStyleAttributes::getStopOpacity() const
         {
             if(maStopOpacity.isSet())
             {
@@ -1984,7 +1985,7 @@ namespace svgio
             return SvgNumber(1.0);
         }
 
-        const SvgNumber SvgStyleAttributes::getFillOpacity() const
+        SvgNumber SvgStyleAttributes::getFillOpacity() const
         {
             if(mbIsClipPathContent)
             {
@@ -2047,7 +2048,7 @@ namespace svgio
             return maStrokeDasharray;
         }
 
-        const SvgNumber SvgStyleAttributes::getStrokeDashOffset() const
+        SvgNumber SvgStyleAttributes::getStrokeDashOffset() const
         {
             if(maStrokeDashOffset.isSet())
             {
@@ -2101,7 +2102,7 @@ namespace svgio
             return StrokeLinejoin_miter;
         }
 
-        const SvgNumber SvgStyleAttributes::getStrokeMiterLimit() const
+        SvgNumber SvgStyleAttributes::getStrokeMiterLimit() const
         {
             if(maStrokeMiterLimit.isSet())
             {
@@ -2119,7 +2120,7 @@ namespace svgio
             return SvgNumber(4.0);
         }
 
-        const SvgNumber SvgStyleAttributes::getStrokeOpacity() const
+        SvgNumber SvgStyleAttributes::getStrokeOpacity() const
         {
             if(maStrokeOpacity.isSet())
             {
@@ -2155,7 +2156,7 @@ namespace svgio
             return maFontFamily;
         }
 
-        const SvgNumber SvgStyleAttributes::getFontSize() const
+        SvgNumber SvgStyleAttributes::getFontSize() const
         {
             if(maFontSize.isSet())
             {
@@ -2351,7 +2352,7 @@ namespace svgio
             return 0;
         }
 
-        const OUString SvgStyleAttributes::getMarkerStartXLink() const
+        OUString SvgStyleAttributes::getMarkerStartXLink() const
         {
             if(maMarkerStartXLink.getLength())
             {
@@ -2383,7 +2384,7 @@ namespace svgio
             return mpMarkerStartXLink;
         }
 
-        const OUString SvgStyleAttributes::getMarkerMidXLink() const
+        OUString SvgStyleAttributes::getMarkerMidXLink() const
         {
             if(maMarkerMidXLink.getLength())
             {
@@ -2415,7 +2416,7 @@ namespace svgio
             return mpMarkerMidXLink;
         }
 
-        const OUString SvgStyleAttributes::getMarkerEndXLink() const
+        OUString SvgStyleAttributes::getMarkerEndXLink() const
         {
             if(maMarkerEndXLink.getLength())
             {
diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx
index cbb171b..e402085 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -30,6 +30,7 @@ namespace svgio
         static OUString aSVGStrViewBox(OUString::createFromAscii("viewBox"));
         static OUString aSVGStrTransform(OUString::createFromAscii("transform"));
         static OUString aSVGStrStyle(OUString::createFromAscii("style"));
+        static OUString aSVGStrDisplay(OUString::createFromAscii("display")); // #i121656#
         static OUString aSVGStrD(OUString::createFromAscii("d"));
         static OUString aSVGStrX(OUString::createFromAscii("x"));
         static OUString aSVGStrY(OUString::createFromAscii("y"));
@@ -173,6 +174,7 @@ namespace svgio
                 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrViewBox, SVGTokenViewBox));
                 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrTransform, SVGTokenTransform));
                 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrStyle, SVGTokenStyle));
+                aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrDisplay, SVGTokenDisplay)); // #i121656#
                 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrD, SVGTokenD));
                 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrX, SVGTokenX));
                 aSVGTokenMapperList.insert(SVGTokenValueType(aSVGStrY, SVGTokenY));
diff --git a/svgio/source/svgreader/svgusenode.cxx b/svgio/source/svgreader/svgusenode.cxx
index 1768a17..4db965a 100644
--- a/svgio/source/svgreader/svgusenode.cxx
+++ b/svgio/source/svgreader/svgusenode.cxx
@@ -145,7 +145,7 @@ namespace svgio
             // try to access link to content
             const SvgNode* mpXLink = getDocument().findSvgNodeById(maXLink);
 
-            if(mpXLink)
+            if(mpXLink && Display_none != mpXLink->getDisplay())
             {
                 // decompose childs
                 drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx
index 1ee5a23..bafeb0e 100644
--- a/svgio/source/svguno/xsvgparser.cxx
+++ b/svgio/source/svguno/xsvgparser.cxx
@@ -162,7 +162,12 @@ namespace svgio
 
                 for(sal_uInt32 a(0); a < nCount; a++)
                 {
-                    rResults[a]->decomposeSvgNode(aRetval, false);
+                    SvgNode* pCandidate = rResults[a];
+
+                    if(Display_none != pCandidate->getDisplay())
+                    {
+                        pCandidate->decomposeSvgNode(aRetval, false);
+                    }
                 }
             }
             else


More information about the Libreoffice-commits mailing list