Rebased ref, commits from common ancestor:
commit 6c30df1a30566877761bb926121836ada62d6fad
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Tue Mar 12 15:30:35 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:49 2019 +0100

    Close all opened List elements at the end of the page
    
    Change-Id: I7c1e11ec57537441417f6b1cebe137587883d8c1

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 8b0ab2b2d09e..c2259341781c 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1339,6 +1339,14 @@ namespace drawinglayer
             // add MetaFile comment, process recursively and add MetaFile 
comment
             mpMetaFile->AddAction(new MetaCommentAction(aCommentStringA));
             process(rBlockPrimitive);
+
+            if (mnCurrentOutlineLevel >= 0 )
+            {
+                // end any opened List structure elements
+                for(sal_Int16 i(0); i <= mnCurrentOutlineLevel; ++i)
+                    mpPDFExtOutDevData->EndStructureElement();
+            }
+
             mpMetaFile->AddAction(new MetaCommentAction(aCommentStringB));
         }
 
commit 9f46257f3cec7e06a89180e80198997f124eedb9
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Tue Mar 12 13:51:04 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:49 2019 +0100

    Limit tagging of background objects to images
    
    i.e. don't tag background custom shapes and other than bitmap
    background fills
    
    Change-Id: I1d42012420f59e1e7b62affb8aca5a8c85688423

diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx 
b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
index 41f5577efa16..c1aedc84a587 100644
--- a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
@@ -31,10 +31,12 @@ namespace drawinglayer
         StructureTagPrimitive2D::StructureTagPrimitive2D(
             const vcl::PDFWriter::StructElement& rStructureElement,
             bool bBackground,
+            bool bIsImage,
             const Primitive2DContainer& rChildren)
         :   GroupPrimitive2D(rChildren),
             maStructureElement(rStructureElement),
-            mbBackground(bBackground)
+            mbBackground(bBackground),
+            mbIsImage(bIsImage)
         {
         }
 
@@ -44,7 +46,8 @@ namespace drawinglayer
             {
                 const StructureTagPrimitive2D& rCompare = static_cast<const 
StructureTagPrimitive2D&>(rPrimitive);
 
-                return (isBackground() == rCompare.isBackground());
+                return (isBackground() == rCompare.isBackground() &&
+                        isImage() == rCompare.isImage());
             }
 
             return false;
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 1573c7fb7880..8b0ab2b2d09e 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2292,18 +2292,31 @@ namespace drawinglayer
         {
             // structured tag primitive
             const vcl::PDFWriter::StructElement& 
rTagElement(rStructureTagCandidate.getStructureElement());
-            bool bTagUsed((vcl::PDFWriter::NonStructElement != rTagElement) && 
!rStructureTagCandidate.isBackground());
+            bool bTagUsed((vcl::PDFWriter::NonStructElement != rTagElement));
 
             if(mpPDFExtOutDevData && bTagUsed)
             {
-                // write start tag
-                mpPDFExtOutDevData->BeginStructureElement(rTagElement);
+                // foreground object: tag as regular structure element
+                if (!rStructureTagCandidate.isBackground())
+                {
+                    mpPDFExtOutDevData->BeginStructureElement(rTagElement);
+                }
+                // background object
+                else
+                {
+                    // background image: tag as artifact
+                    if (rStructureTagCandidate.isImage())
+                        
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::NonStructElement);
+                    // any other background object: do not tag
+                    else
+                        bTagUsed = false;
+                }
             }
 
             // process children normally
             process(rStructureTagCandidate.getChildren());
 
-            if(mpPDFExtOutDevData &&  bTagUsed)
+            if(mpPDFExtOutDevData && bTagUsed)
             {
                 // write end tag
                 mpPDFExtOutDevData->EndStructureElement();
diff --git a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx 
b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
index b6e9ad94ede8..255dc5e64f56 100644
--- a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
@@ -48,20 +48,23 @@ namespace drawinglayer
             /// the PDF structure element this grouping represents
             vcl::PDFWriter::StructElement           maStructureElement;
 
-            ///Z flag for background contenht that may be handled as
-            /// Tagged PDF '/Artifact'
+            /// flag for background object
             bool                                    mbBackground;
+            /// flag for image (OBJ_GRAF)
+            bool                                    mbIsImage;
 
         public:
             /// constructor
             StructureTagPrimitive2D(
                 const vcl::PDFWriter::StructElement& rStructureElement,
                 bool bBackground,
+                bool bIsImage,
                 const Primitive2DContainer& rChildren);
 
             /// data read access
             const vcl::PDFWriter::StructElement& getStructureElement() const { 
return maStructureElement; }
             bool isBackground() const { return mbBackground; }
+            bool isImage() const { return mbIsImage; }
 
             /// compare operator
             virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index b8cd7d7b4691..5b93cbeb6a3a 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1807,14 +1807,15 @@ drawinglayer::primitive2d::Primitive2DContainer 
ImplRenderPaintProc::createRedir
                         // embed Primitive2DSequence in a structure tag 
element for
                         // exactly this purpose (StructureTagPrimitive2D)
 
-                        //Z
                         const SdrPage* 
pSdrPage(pObject->getSdrPageFromSdrObject());
                         const bool bBackground(nullptr != pSdrPage && 
pSdrPage->IsMasterPage());
+                        const bool bImage(pObject->GetObjIdentifier() == 
OBJ_GRAF);
 
                         const drawinglayer::primitive2d::Primitive2DReference 
xReference(
                             new 
drawinglayer::primitive2d::StructureTagPrimitive2D(
                                 eElement,
                                 bBackground,
+                                bImage,
                                 xRetval));
 
                         xRetval = 
drawinglayer::primitive2d::Primitive2DContainer { xReference };
commit 13b4916833a54037bcf3bef1dc0ddf3b416d2100
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Fri Mar 8 21:43:27 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:49 2019 +0100

    For now, skip tagged PDF export of background objects
    
    This reverts commit 9d5eceaaa5705bddd687db8b4e7aef91591dd5fc and
    bf978a527fb0bba27cd2c83443e70ad86a63d819 until a better solution is
    found because exporting them as either Figure or Artifact screws up
    document structure badly
    
    Change-Id: I6c0f28a29653aa294362c6249ad16e48f603707a

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 76ca3013fb9c..1573c7fb7880 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2292,14 +2292,12 @@ namespace drawinglayer
         {
             // structured tag primitive
             const vcl::PDFWriter::StructElement& 
rTagElement(rStructureTagCandidate.getStructureElement());
-            const bool bTagUsed(vcl::PDFWriter::NonStructElement != 
rTagElement);
-            const bool bIsBackground(rStructureTagCandidate.isBackground());
+            bool bTagUsed((vcl::PDFWriter::NonStructElement != rTagElement) && 
!rStructureTagCandidate.isBackground());
 
             if(mpPDFExtOutDevData && bTagUsed)
             {
-                // Write start tag. For background elements use 
NonStructElement instead of real element type (e.g. Figure)
-                // to guarantee it gets exported as artifact (tagged PDF)
-                mpPDFExtOutDevData->BeginStructureElement(bIsBackground ? 
vcl::PDFWriter::NonStructElement : rTagElement);
+                // write start tag
+                mpPDFExtOutDevData->BeginStructureElement(rTagElement);
             }
 
             // process children normally
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index f52893c2b237..acec33b4ec5c 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10750,7 +10750,7 @@ void PDFWriterImpl::beginStructureElementMCSeq()
              )
     {
         OStringBuffer aLine( 128 );
-        aLine.append( "/Artifact <<>>BDC\n" );
+        aLine.append( "/Artifact BMC\n" );
         writeBuffer( aLine.getStr(), aLine.getLength() );
         // mark element MC sequence as open
         m_aStructure[ m_nCurrentStructElement ].m_bOpenMCSeq = true;
commit 114176935b6fbb846e27955f59d730663486f755
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Wed Mar 6 17:22:21 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:49 2019 +0100

    Tentative fix of tagged PDF export of artifacts
    
    quote PDF standard, chapter 14.8.2.2.2:
    " ... to aid in text reflow, artifacts should be defined with property
    lists whenever possible."
    
    So instead of 'Artifact BMC ... EMC', we export
    'Artifact BDC propertyList ... EMC' where property list is empty
    
    This is also how an example at
    
https://www.w3.org/WAI/WCAG20/Techniques/working-examples/PDF4/decorative-image.pdf
    implements things
    
    Change-Id: I06e9a9119dd28ee80136393528fdd59d75f16951

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index acec33b4ec5c..f52893c2b237 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -10750,7 +10750,7 @@ void PDFWriterImpl::beginStructureElementMCSeq()
              )
     {
         OStringBuffer aLine( 128 );
-        aLine.append( "/Artifact BMC\n" );
+        aLine.append( "/Artifact <<>>BDC\n" );
         writeBuffer( aLine.getStr(), aLine.getLength() );
         // mark element MC sequence as open
         m_aStructure[ m_nCurrentStructElement ].m_bOpenMCSeq = true;
commit 2bf1a40302a1af2a3237d54319fafa7f16c1ba3a
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Wed Mar 6 14:26:40 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:49 2019 +0100

    Correct hierarchy of L, LI structure elements
    
    in particular, don't terminate LI prematurely
    
    Change-Id: Iaf642f547b072b12ccbf861536825a2526b8798a

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 406564ce9f4d..76ca3013fb9c 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1327,8 +1327,8 @@ namespace drawinglayer
                 mpPDFExtOutDevData->EndStructureElement(); // end ListItem
                 mbInListItem = false;
             }
-
-            mpPDFExtOutDevData->EndStructureElement();
+            else
+                mpPDFExtOutDevData->EndStructureElement(); // end Paragraph
         }
 
         void 
VclMetafileProcessor2D::processTextHierarchyBlockPrimitive2D(const 
primitive2d::TextHierarchyBlockPrimitive2D& rBlockPrimitive)
commit 9d9c9e378adf7fe786c5e77f1217741a40d49cc9
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Tue Feb 19 15:48:25 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:49 2019 +0100

    Don't include shape/object name when exporting to tagged PDF
    
    most of the time shapes have generated names such as 'Shape 42', those
    have ~no added value so let's not include them in Alt text
    
    Change-Id: I30314d5e901e11722e609dbf7ceddf74c5ed9707

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 5c06999ce20e..406564ce9f4d 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1008,15 +1008,10 @@ namespace drawinglayer
                 // for PDF export
                 if(mpPDFExtOutDevData->GetIsExportTaggedPDF() && nullptr != 
getObjectInfoPrimitive2D())
                 {
-                    OUString 
aAlternateDescription(getObjectInfoPrimitive2D()->getName());
+                    OUString aAlternateDescription;
 
                     if(!getObjectInfoPrimitive2D()->getTitle().isEmpty())
                     {
-                        if(!aAlternateDescription.isEmpty())
-                        {
-                            aAlternateDescription += OUString(" - ");
-                        }
-
                         aAlternateDescription += 
getObjectInfoPrimitive2D()->getTitle();
                     }
 
commit c4aae52d5d56c00d035d6d9ad4e36eed1521c574
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Mon Feb 4 11:54:27 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:48 2019 +0100

    PPTX import of shape description
    
    Change-Id: I7fcd5608a8cdbeea9ea15c9c9aa32c9020154750

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 40a80ae113dc..0028aea3350d 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -148,6 +148,7 @@ public:
     const OUString&                 getInternalName() const { return 
msInternalName; }
     void                            setId( const OUString& rId ) { msId = rId; 
}
     const OUString&                 getId() { return msId; }
+    void                            setDescription( const OUString& rDescr ) { 
msDescription = rDescr; }
     void                            setHidden( bool bHidden ) { mbHidden = 
bHidden; }
     void                            setHiddenMasterShape( bool 
bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; }
     void                            setSubType( sal_Int32 nSubType ) { 
mnSubType = nSubType; }
@@ -304,6 +305,7 @@ protected:
     OUString                    msName;
     OUString                    msInternalName; // used by diagram; not 
displayed in UI
     OUString                    msId;
+    OUString                    msDescription;
     sal_Int32                   mnSubType;      // if this type is not zero, 
then the shape is a placeholder
     OptValue< sal_Int32 >       moSubTypeIndex;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 4c552194b08a..1371555240e0 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -851,6 +851,11 @@ Reference< XShape > const & Shape::createAndInsert(
             if( xNamed.is() )
                 xNamed->setName( msName );
         }
+        if( !msDescription.isEmpty() )
+        {
+            const OUString sDescription( "Description" );
+            xSet->setPropertyValue( sDescription, Any( msDescription ) );
+        }
         if (aServiceName != "com.sun.star.text.TextFrame")
             rxShapes->add( mxShape );
 
diff --git a/oox/source/drawingml/shapecontext.cxx 
b/oox/source/drawingml/shapecontext.cxx
index 3abe2dee0adf..03b33cb685b4 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -73,6 +73,7 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 
aElementToken, const
         mpShapePtr->setHidden( rAttribs.getBool( XML_hidden, false ) );
         mpShapePtr->setId( rAttribs.getString( XML_id ).get() );
         mpShapePtr->setName( rAttribs.getString( XML_name ).get() );
+        mpShapePtr->setDescription( rAttribs.getString( XML_descr ).get() );
         break;
     }
     case XML_hlinkMouseOver:
diff --git a/sd/qa/unit/data/pptx/altdescription.pptx 
b/sd/qa/unit/data/pptx/altdescription.pptx
new file mode 100644
index 000000000000..f116efe41171
Binary files /dev/null and b/sd/qa/unit/data/pptx/altdescription.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 2f506414f920..b0f4553b3801 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -191,6 +191,7 @@ public:
     void testTdf123090();
     void testTdf120028();
     void testTdf120028b();
+    void testDescriptionImport();
 
     CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -276,6 +277,7 @@ public:
     CPPUNIT_TEST(testTdf123090);
     CPPUNIT_TEST(testTdf120028);
     CPPUNIT_TEST(testTdf120028b);
+    CPPUNIT_TEST(testDescriptionImport);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -2663,6 +2665,23 @@ void SdImportTest::testTdf120028b()
     xDocShRef->DoClose();
 }
 
+void SdImportTest::testDescriptionImport()
+{
+    sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/altdescription.pptx"),
 PPTX);
+
+    uno::Reference<beans::XPropertySet> xPropertySet(
+        getShapeFromPage(/*nShape=*/2, /*nPage=*/0, xDocShRef));
+    OUString sDesc;
+
+    xPropertySet->getPropertyValue("Description") >>= sDesc;
+
+    CPPUNIT_ASSERT_EQUAL(OUString("We Can Do It!"), sDesc);
+
+    xDocShRef->DoClose();
+
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit e0262e56af6ed57ba56a73e905a6da6942cba7fe
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Thu Jan 31 17:18:36 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:48 2019 +0100

    Export background images provided by master page as artifacts
    
    so that screenreaders don't announce them. To make this happen,
    pass them as NonStructElement to PDF writer
    
    Change-Id: I94d52ee0207cd6362edabfb9b891faa7fe341543

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index ece83ddc8c52..5c06999ce20e 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2297,38 +2297,14 @@ namespace drawinglayer
         {
             // structured tag primitive
             const vcl::PDFWriter::StructElement& 
rTagElement(rStructureTagCandidate.getStructureElement());
-            bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement);
+            const bool bTagUsed(vcl::PDFWriter::NonStructElement != 
rTagElement);
+            const bool bIsBackground(rStructureTagCandidate.isBackground());
 
-            //Z For now, just do not create StructureTag(s) for 
hidden/background
-            // (Graphic)Objects - see '/Artifact' comments below
-            if(bTagUsed && rStructureTagCandidate.isBackground())
+            if(mpPDFExtOutDevData && bTagUsed)
             {
-                bTagUsed = false;
-            }
-
-            if(mpPDFExtOutDevData &&  bTagUsed)
-            {
-                // write start tag
-                mpPDFExtOutDevData->BeginStructureElement(rTagElement);
-
-                // if(rStructureTagCandidate.isBackground())
-                // {
-                //     //Z need to somehow apply '/Artifact' information...
-                //     // - Already experimented with adding two 
BeginStructureElement adding
-                //     //   a 'vcl::PDFWriter::Artifact' -> not really what 
e.g. PAC3 expects.
-                //     // - May also be adding someting using 
'SetStructureAttribute' and
-                //     //   extending vcl::PDFWriter::StructAttribute...
-                //     // - Simple solution for now (see above): Just do not 
create
-                //     //   StructureTag(s) for hidden/background 
(Graphic)Objects. That
-                //     //   works, shows all content in PDF renderers, but 
hides in
-                //     //   TaggedStructure. But: also not visible in PAC3's 
'LogicalStructure'
-                //     //   View where there is a tab for 'Artifacts' - I 
*guess* a correctly
-                //     //   tagged '/Artifact' should appear there.
-                //     // Unfortunately found no real example - there is 
https://www.w3.org/TR/WCAG20-TECHS/PDF4.html
-                //     // which claims to have an example in
-                //     // 
https://www.w3.org/WAI/WCAG20/Techniques/working-examples/PDF4/decorative-image.docx
-                //     // but that file has no '/Artifact' entries at all...
-                // }
+                // Write start tag. For background elements use 
NonStructElement instead of real element type (e.g. Figure)
+                // to guarantee it gets exported as artifact (tagged PDF)
+                mpPDFExtOutDevData->BeginStructureElement(bIsBackground ? 
vcl::PDFWriter::NonStructElement : rTagElement);
             }
 
             // process children normally
commit bf2167c9bf586cabf77dd2e5c2eb832642e7e90e
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Tue Jan 29 16:20:56 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:48 2019 +0100

    Process entire list item (Lbl + LBody) in tagged PDF-compliant way
    
    implemented as described in
    
https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G21.1021281
    
    Change-Id: I943c35cb8ee833ff46ff594e6b6c1025450b9ca4

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index bbc7d80361a7..ece83ddc8c52 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -565,7 +565,9 @@ namespace drawinglayer
             mnSvtGraphicStrokeCount(0),
             mfCurrentUnifiedTransparence(0.0),
             mpPDFExtOutDevData(dynamic_cast< vcl::PDFExtOutDevData* 
>(rOutDev.GetExtOutDevData())),
-            mnCurrentOutlineLevel(-1)
+            mnCurrentOutlineLevel(-1),
+            mbInListItem(false),
+            mbBulletPresent(false)
         {
             OSL_ENSURE(rOutDev.GetConnectMetaFile(), "VclMetafileProcessor2D: 
Used on OutDev which has no MetaFile Target (!)");
             // draw to logic coordinates, do not initialize 
maCurrentTransformation to viewTransformation
@@ -1234,9 +1236,19 @@ namespace drawinglayer
             // "XTEXT_EOC" is used, use here, too.
             const OString aCommentString("XTEXT_EOC");
 
+            // this is a part of list item, start LILabel ( = bullet)
+            if(mbInListItem)
+                
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::LILabel);
+
             // process recursively and add MetaFile comment
             process(rBulletPrimitive);
             mpMetaFile->AddAction(new MetaCommentAction(aCommentString));
+
+            if(mbInListItem)
+            {
+                mpPDFExtOutDevData->EndStructureElement(); // end LILabel
+                mbBulletPresent = true;
+            }
         }
 
         void 
VclMetafileProcessor2D::processTextHierarchyParagraphPrimitive2D(const 
primitive2d::TextHierarchyParagraphPrimitive2D& rParagraphPrimitive)
@@ -1303,7 +1315,7 @@ namespace drawinglayer
             {
                 // Dump as ListItem
                 mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::ListItem );
-                mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::LIBody );
+                mbInListItem = true;
             }
             else
             {
@@ -1317,7 +1329,8 @@ namespace drawinglayer
 
             if(bDumpAsListItem)
             {
-                mpPDFExtOutDevData->EndStructureElement();
+                mpPDFExtOutDevData->EndStructureElement(); // end ListItem
+                mbInListItem = false;
             }
 
             mpPDFExtOutDevData->EndStructureElement();
@@ -1340,9 +1353,20 @@ namespace drawinglayer
             const DrawModeFlags 
nOriginalDrawMode(mpOutputDevice->GetDrawMode());
             adaptTextToFillDrawMode();
 
+            // this is a 2nd portion of list item
+            // bullet has been already processed, start LIBody
+            if (mbInListItem && mbBulletPresent)
+                
mpPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::LIBody);
+
             // directdraw of text simple portion; use default processing
             RenderTextSimpleOrDecoratedPortionPrimitive2D(rTextCandidate);
 
+            if (mbInListItem && mbBulletPresent)
+            {
+                mpPDFExtOutDevData->EndStructureElement(); // end LIBody
+                mbBulletPresent = false;
+            }
+
             // restore DrawMode
             mpOutputDevice->SetDrawMode(nOriginalDrawMode);
 
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
index a897d17ddfff..3b9f39f804a6 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
@@ -174,6 +174,8 @@ namespace drawinglayer
             // like '/L', '/LI', 'LBody' instead of simple '/P' (Paragraph).
             // The value -1 means 'no OutlineLevel' and values >= 0 express 
the level.
             sal_Int16                           mnCurrentOutlineLevel;
+            bool mbInListItem;
+            bool mbBulletPresent;
 
         protected:
             /*  the local processor for BasePrimitive2D-Implementation based 
primitives,
commit e70b2e2bb30bde3d8c60efdd4c588ebb3c5a2481
Author:     Katarina Behrens <katarina.behr...@cib.de>
AuthorDate: Tue Jan 15 14:11:49 2019 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:47 2019 +0100

    Different way to determine if paragraph is within a list
    
    pptx import seems little flaky in this regard, EE_PARA_OUTLLEVEL
    isn't always set (no such problem with odp). Instead, we'll query
    paragraph's depth and visibility of bullets/numbering
    
    Change-Id: Ia8cf6b7bb0e065a1378875442a99d79b006e2d77

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 05490ba7960d..ff83f15c4274 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -500,15 +500,15 @@ namespace
 
     void 
impTextBreakupHandler::impFlushLinePrimitivesToParagraphPrimitives(sal_Int32 
nPara)
     {
+        sal_Int16 nDepth = mrOutliner.GetDepth(nPara);
+        EBulletInfo eInfo = mrOutliner.GetBulletInfo(nPara);
+        // Pass -1 to signal VclMetafileProcessor2D that there is no active
+        // bullets/numbering in this paragraph (i.e. this is normal text)
+        const sal_Int16 nOutlineLevel( eInfo.bVisible ?  nDepth : -1);
+
         // ALWAYS create a paragraph primitive, even when no content was 
added. This is done to
         // have the correct paragraph count even with empty paragraphs. Those 
paragraphs will
         // have an empty sub-PrimitiveSequence.
-        const sal_Int16 nOutlineLevel(nPara >= 0 && nPara < 
mrOutliner.GetParagraphCount()
-            ? 
mrOutliner.GetParaAttribs(nPara).Get(EE_PARA_OUTLLEVEL).GetValue()
-            : -1);
-
-        //Z This basically makes OutlineLevel information available in 
VclMetafileProcessor2D,
-        //Z so may be used similar to 'SetAlternateText' in 
processGraphicPrimitive2D for PDF export
         maParagraphPrimitives.push_back(
             new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(
                 maLinePrimitives,
commit ef03e3a0b10104d0ff4dd96d9d14f00d8bc7a972
Author:     Thorsten Behrens <thorsten.behr...@cib.de>
AuthorDate: Fri Dec 21 00:57:37 2018 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:47 2019 +0100

    fix crash
    
    Change-Id: Ia0332b62daad878dd3af939a15a9947562b8ed0d

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 24e4b03f39f0..64fee22b4020 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1245,7 +1245,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* 
pOut, const SwRect &rGrfAr
                     aTempGraphicObject,
                     aGrfAttr,
                     aGraphicTransform,
-                    nullptr == pGrfNd->GetFlyFormat() ? OUString() : 
pGrfNd->GetFlyFormat()->GetName(),
+                    OUString(),
                     rNoTNd.GetTitle(),
                     rNoTNd.GetDescription());
 
commit 9c7b28147a084e843dbcb0b6e22b9f61abab599d
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Jul 26 14:36:38 2018 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:47 2019 +0100

    loplugin:returnconstant in svl,svtools
    
    Change-Id: Id297a513f3313e10531f0ccd99a16277e4e37fa1
    Reviewed-on: https://gerrit.libreoffice.org/58111
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 928dfebe109794eb079469a46f549e25b3b1e89d)

diff --git a/include/svl/filenotation.hxx b/include/svl/filenotation.hxx
index e5cf1c78a320..d33e442b9396 100644
--- a/include/svl/filenotation.hxx
+++ b/include/svl/filenotation.hxx
@@ -47,7 +47,7 @@ namespace svt
     private:
         SVL_DLLPRIVATE void construct( const OUString& _rUrlOrPath );
         SVL_DLLPRIVATE bool    implInitWithSystemNotation( const OUString& 
_rSystemPath );
-        SVL_DLLPRIVATE bool    implInitWithURLNotation( const OUString& _rURL 
);
+        SVL_DLLPRIVATE void    implInitWithURLNotation( const OUString& _rURL 
);
 
         OUString     m_sSystem;
         OUString     m_sFileURL;
diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
index 450eed0e82c0..381ef70570c4 100644
--- a/include/svtools/colorcfg.hxx
+++ b/include/svtools/colorcfg.hxx
@@ -121,7 +121,7 @@ public:
     css::uno::Sequence< OUString >  GetSchemeNames() const;
     void                        DeleteScheme(const OUString& rScheme );
     void                        AddScheme(const OUString& rScheme );
-    bool                        LoadScheme(const OUString& rScheme );
+    void                        LoadScheme(const OUString& rScheme );
     const OUString&             GetCurrentSchemeName() const;
     void                        SetCurrentSchemeName(const OUString& rScheme);
 
diff --git a/include/svtools/extcolorcfg.hxx b/include/svtools/extcolorcfg.hxx
index 17e885661371..752784c92390 100644
--- a/include/svtools/extcolorcfg.hxx
+++ b/include/svtools/extcolorcfg.hxx
@@ -87,7 +87,7 @@ public:
 
     void                        DeleteScheme(const OUString& rScheme );
     void                        AddScheme(const OUString& rScheme );
-    bool                        LoadScheme(const OUString& rScheme );
+    void                        LoadScheme(const OUString& rScheme );
     void                        SetCurrentSchemeName(const OUString& rScheme);
 
     sal_Int32                   GetComponentCount() const;
diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index 232248d20039..af094cbab817 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -46,8 +46,8 @@ private:
     // Import/Export
     void                ImpWriteCERN( SvStream& rOStm ) const;
     void                ImpWriteNCSA( SvStream& rOStm ) const;
-    sal_uLong           ImpReadCERN( SvStream& rOStm );
-    sal_uLong           ImpReadNCSA( SvStream& rOStm );
+    void                ImpReadCERN( SvStream& rOStm );
+    void                ImpReadNCSA( SvStream& rOStm );
 
     void                ImpReadCERNLine( const OString& rLine );
     static Point        ImpReadCERNCoords( const char** ppStr );
diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx
index a6ca61dceef0..3b603f47bbcf 100644
--- a/include/svtools/svlbitm.hxx
+++ b/include/svtools/svlbitm.hxx
@@ -154,7 +154,7 @@ public:
                               SvViewDataItem* pViewData = nullptr) override;
 
     virtual SvLBoxItemType GetType() const override;
-    bool ClickHdl( SvTreeListEntry* );
+    void ClickHdl( SvTreeListEntry* );
 
     virtual void Paint(const Point& rPos,
                        SvTreeListBox& rOutDev,
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index c1350f86270a..049e70db5689 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -702,11 +702,10 @@ void SAL_CALL FSStorage::renameElement( const OUString& 
aElementName, const OUSt
         uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
         ::ucbhelper::Content aSourceContent( aOldURL.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ), xDummyEnv, 
comphelper::getProcessComponentContext() );
 
-        if ( !GetContent()->transferContent( aSourceContent,
+        GetContent()->transferContent( aSourceContent,
                                             ::ucbhelper::InsertOperation::Move,
                                             aNewName,
-                                            ucb::NameClash::ERROR ) )
-            throw io::IOException(); // TODO: error handling
+                                            ucb::NameClash::ERROR );
     }
     catch( embed::InvalidStorageException& )
     {
diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx
index bc3f5ccf946c..c4337708bc8b 100644
--- a/svl/source/misc/filenotation.cxx
+++ b/svl/source/misc/filenotation.cxx
@@ -70,11 +70,10 @@ namespace svt
         return bSuccess;
     }
 
-    bool OFileNotation::implInitWithURLNotation( const OUString& _rURL )
+    void OFileNotation::implInitWithURLNotation( const OUString& _rURL )
     {
         m_sFileURL = _rURL;
         osl_getSystemPathFromFileURL( _rURL.pData, &m_sSystem.pData );
-        return true;
     }
 
     void OFileNotation::construct( const OUString& _rUrlOrPath )
@@ -86,7 +85,8 @@ namespace svt
         {
             case INetProtocol::File:
                 // file URL
-                bSuccess = implInitWithURLNotation( _rUrlOrPath );
+                implInitWithURLNotation( _rUrlOrPath );
+                bSuccess = true;
                 break;
 
             case INetProtocol::NotValid:
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 580c28034f47..378f046a3714 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -540,7 +540,7 @@ void EditableColorConfig::AddScheme(const OUString& rScheme 
)
     m_pImpl->AddScheme(rScheme);
 }
 
-bool EditableColorConfig::LoadScheme(const OUString& rScheme )
+void EditableColorConfig::LoadScheme(const OUString& rScheme )
 {
     if(m_bModified)
         m_pImpl->SetModified();
@@ -550,7 +550,6 @@ bool EditableColorConfig::LoadScheme(const OUString& 
rScheme )
     m_pImpl->Load(rScheme);
     //the name of the loaded scheme has to be committed separately
     m_pImpl->CommitCurrentSchemeName();
-    return true;
 }
 
 const OUString& EditableColorConfig::GetCurrentSchemeName()const
diff --git a/svtools/source/config/extcolorcfg.cxx 
b/svtools/source/config/extcolorcfg.cxx
index 76c4c6ac5343..8e09110ca02f 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -596,7 +596,7 @@ void EditableExtendedColorConfig::AddScheme(const OUString& 
rScheme )
     m_pImpl->AddScheme(rScheme);
 }
 
-bool EditableExtendedColorConfig::LoadScheme(const OUString& rScheme )
+void EditableExtendedColorConfig::LoadScheme(const OUString& rScheme )
 {
     if(m_bModified)
         m_pImpl->SetModified();
@@ -606,7 +606,6 @@ bool EditableExtendedColorConfig::LoadScheme(const 
OUString& rScheme )
     m_pImpl->Load(rScheme);
     //the name of the loaded scheme has to be committed separately
     m_pImpl->CommitCurrentSchemeName();
-    return true;
 }
 
 // Changes the name of the current scheme but doesn't load it!
diff --git a/svtools/source/contnr/svlbitm.cxx 
b/svtools/source/contnr/svlbitm.cxx
index f12c2911673f..11eeb0165f5e 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -248,7 +248,7 @@ SvLBoxItemType SvLBoxButton::GetType() const
     return SvLBoxItemType::Button;
 }
 
-bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry )
+void SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry )
 {
     if ( CheckModification() )
     {
@@ -259,7 +259,6 @@ bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry )
         pData->StoreButtonState( pEntry );
         pData->CallLink();
     }
-    return false;
 }
 
 void SvLBoxButton::Paint(
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index e1424f5d47b4..99fc73b4bf70 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -219,8 +219,8 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong 
nFormat  )
     switch ( nFormat )
     {
         case IMAP_FORMAT_BIN    : Read( rIStm ); break;
-        case IMAP_FORMAT_CERN   : nRet = ImpReadCERN( rIStm ); break;
-        case IMAP_FORMAT_NCSA   : nRet = ImpReadNCSA( rIStm ); break;
+        case IMAP_FORMAT_CERN   : ImpReadCERN( rIStm ); break;
+        case IMAP_FORMAT_NCSA   : ImpReadNCSA( rIStm ); break;
 
         default:
         break;
@@ -232,7 +232,7 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong 
nFormat  )
     return nRet;
 }
 
-sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm )
+void ImageMap::ImpReadCERN( SvStream& rIStm )
 {
     // delete old content
     ClearImageMap();
@@ -240,8 +240,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm )
     OString aStr;
     while ( rIStm.ReadLine( aStr ) )
         ImpReadCERNLine( aStr );
-
-    return IMAP_ERR_OK;
 }
 
 void ImageMap::ImpReadCERNLine( const OString& rLine  )
@@ -370,7 +368,7 @@ OUString ImageMap::ImpReadCERNURL( const char** ppStr )
     return INetURLObject::GetAbsURL( "", aStr );
 }
 
-sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm )
+void ImageMap::ImpReadNCSA( SvStream& rIStm )
 {
     // delete old content
     ClearImageMap();
@@ -378,8 +376,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm )
     OString aStr;
     while ( rIStm.ReadLine( aStr ) )
         ImpReadNCSALine( aStr );
-
-    return IMAP_ERR_OK;
 }
 
 void ImageMap::ImpReadNCSALine( const OString& rLine )
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 65757ccbda15..4c337df681d3 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -508,7 +508,7 @@ public:
     explicit SvUnoImageMap();
     SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* 
pSupportedMacroItems );
 
-    bool fillImageMap( ImageMap& rMap ) const;
+    void fillImageMap( ImageMap& rMap ) const;
     /// @throws IllegalArgumentException
     static SvUnoImageMapObject* getObject( const Any& aElement );
 
@@ -667,7 +667,7 @@ Sequence< OUString > SAL_CALL 
SvUnoImageMap::getSupportedServiceNames(  )
     return Sequence< OUString >( &aSN, 1 );
 }
 
-bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const
+void SvUnoImageMap::fillImageMap( ImageMap& rMap ) const
 {
     rMap.ClearImageMap();
 
@@ -679,8 +679,6 @@ bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const
         rMap.InsertIMapObject( *pNewMapObject );
         delete pNewMapObject;
     }
-
-    return true;
 }
 
 
@@ -718,7 +716,8 @@ bool SvUnoImageMap_fillImageMap( const Reference< 
XInterface >& xImageMap, Image
     if( nullptr == pUnoImageMap )
         return false;
 
-    return pUnoImageMap->fillImageMap( rMap );
+    pUnoImageMap->fillImageMap( rMap );
+    return true;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1d9bcf421486f36e620a0743a81ea243b8ea3abc
Author:     Fridrich Štrba <fridrich.st...@bluewin.ch>
AuthorDate: Thu Jul 12 11:57:07 2018 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:47 2019 +0100

    call System.runFinalizersOnExit by reflection, since it was removed in jdk11
    
    Change-Id: I542c87bc1de21727a035cc6ac3b3e20c0ccfb5f7
    (cherry picked from commit 983035cc974faf9a2dcc1ecdf01391e618970a7f)

diff --git a/external/hsqldb/UnpackedTarball_hsqldb.mk 
b/external/hsqldb/UnpackedTarball_hsqldb.mk
index fc6c18f77c23..cbba770f19a0 100644
--- a/external/hsqldb/UnpackedTarball_hsqldb.mk
+++ b/external/hsqldb/UnpackedTarball_hsqldb.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,hsqldb,\
        external/hsqldb/patches/i104901.patch \
        external/hsqldb/patches/fdo36824.patch \
        external/hsqldb/patches/limit_as_table_alias.patch \
+       external/hsqldb/patches/hsqldb-runFinalizersOnExit.patch \
        $(if $(HSQLDB_USE_JDBC_4_1),\
                external/hsqldb/patches/jdbc-4.1.patch \
                external/hsqldb/patches/multipleResultSets.patch \
diff --git a/external/hsqldb/patches/hsqldb-runFinalizersOnExit.patch 
b/external/hsqldb/patches/hsqldb-runFinalizersOnExit.patch
new file mode 100644
index 000000000000..214dc2c2b2e1
--- /dev/null
+++ b/external/hsqldb/patches/hsqldb-runFinalizersOnExit.patch
@@ -0,0 +1,14 @@
+--- misc/hsqldb/src/org/hsqldb/lib/java/JavaSystem.java        2008-03-16 
23:51:35.000000000 +0100
++++ misc/build/hsqldb/src/org/hsqldb/lib/java/JavaSystem.java  2018-07-12 
11:46:57.997837180 +0200
+@@ -160,8 +160,9 @@
+     public static void runFinalizers() {
+ 
+ //#ifdef JAVA2FULL
+-        System.runFinalizersOnExit(true);
+-
++        try {
++            System.class.getMethod("runFinalizersOnExit", 
boolean.class).invoke(null, true);
++        } catch (Exception e) {}
+ //#endif
+     }
+ 
commit e2fabc812615d9b504d3263818a251c597a81206
Author:     Armin Le Grand <armin.le.gr...@cib.de>
AuthorDate: Thu Dec 20 17:31:32 2018 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:47 2019 +0100

    Enhance TaggedPDF export (accessibility)
    
    The current tagged PDF export does not well support
    quite some internal structures. This includes all
    apps (Draw/Impress/Writer/Calc) and some areas.
    
    Area AlternativeText ('/Alt'):
    
    Only writer currently at least adds Title information,
    but we also have Description (MS does add) and Name.
    Target is to add this information when available to
    content frames.
    Writer did that by manually adding that tag using
    PDFExtOutDevData::SetAlternateText, but only used
    Title so far.
    To make this work as broad as possible, better add
    this to primitives. There is already a primitive called
    ObjectInfoPrimitive2D that encapsulates any content
    adding Name/Title/Description using GroupPrimitive
    functionality.
    Changed Writer to use that way. Draw/Impress already
    uses it, all apps now use graphic paint using primitives,
    so we have a natural target to encapsulate. Add support
    to VclMetafileProcessor2D to interpret it and add
    - if mpPDFExtOutDevData->GetIsExportTaggedPDF() - that
    data using a combination of Name/Title/Description and
    add using mpPDFExtOutDevData->SetAlternateText.
    This works for Draw/Impress/Writer, but not for Calc
    because Calc does not create more complex data structures,
    so SetAlternateText does not work (see
    PDFWriterImpl::setAlternateText for more infos).
    
    Area Tagged ListContent (use 'L', 'LI', 'LBody' PDF tags):
    
    To support this in Draw/Impress, we can also use a similar
    way to support in primitives. For this I evaluated how to
    add needed OutlineLevel information to the existing (and
    already used to write 'P') TextHierarchyParagraphPrimitive2D.
    Added this and now ready to use in VclMetafileProcessor2D
    ::processTextHierarchyParagraphPrimitive2D.
    Added now using the OutlineLevel information at the
    TextHierarchyParagraphPrimitive2D. Made sure there are
    fallbacks to unchanged old behaviour when no PDF export
    or no Tagged-PDF used. Creating now '/L', '/LI' and '/LBody'
    statements as tagged PDF wants us to do.
    Exported PDF still works well while additionally a verifier
    as 'PAC 3' shows the expected and wanted structure.
    This will work now for any text in Draw/Impress and for
    Draw-Objects using Lists in Calc. Need to check for direct
    text in Calc cells and Writer - and guess how big the
    effort would be for these to make it work there, too.
    
    Area '/Artifact':
    
    Target is to avoid too much ScreenReader hassle when
    Impress uses Pictures/FillPatterns etc. in Background
    - what means on MasterPage in Impress.
    Experimented with different possibilities. Decided to use
    existing StructureTagPrimitive2D and extend for info if
    encapsulated data is 'Background' data -> on MasterPage.
    Can be created in ImplRenderPaintProc in method
    createRedirectedPrimitive2DSeque as needed by checking
    for MasterPage member (remember: primitives need to be
    as independent from model data as possible, never include
    e.g. a SdrObject reference in any way).
    Tried different ways to use this in VclMetafileProcessor2D
    processStructureTagPrimitive2D, see comments there. Current
    best solution is to just *not* create StuctureTag information
    for these objects.
    
    Change-Id: Ib2a578b02c1256758cda6d15ce37799803d8205c

diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx 
b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
index e76269788378..41f5577efa16 100644
--- a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
@@ -30,12 +30,26 @@ namespace drawinglayer
     {
         StructureTagPrimitive2D::StructureTagPrimitive2D(
             const vcl::PDFWriter::StructElement& rStructureElement,
+            bool bBackground,
             const Primitive2DContainer& rChildren)
         :   GroupPrimitive2D(rChildren),
-            maStructureElement(rStructureElement)
+            maStructureElement(rStructureElement),
+            mbBackground(bBackground)
         {
         }
 
+        bool StructureTagPrimitive2D::operator==(const BasePrimitive2D& 
rPrimitive) const
+        {
+            if(GroupPrimitive2D::operator==(rPrimitive))
+            {
+                const StructureTagPrimitive2D& rCompare = static_cast<const 
StructureTagPrimitive2D&>(rPrimitive);
+
+                return (isBackground() == rCompare.isBackground());
+            }
+
+            return false;
+        }
+
         // provide unique ID
         ImplPrimitive2DIDBlock(StructureTagPrimitive2D, 
PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D)
 
diff --git a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx 
b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
index 45fa8531bee3..cbacb022759c 100644
--- a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx
@@ -44,9 +44,24 @@ namespace drawinglayer
 {
     namespace primitive2d
     {
-        
TextHierarchyParagraphPrimitive2D::TextHierarchyParagraphPrimitive2D(const 
Primitive2DContainer& rChildren)
-        :   GroupPrimitive2D(rChildren)
+        TextHierarchyParagraphPrimitive2D::TextHierarchyParagraphPrimitive2D(
+            const Primitive2DContainer& rChildren,
+            sal_Int16 nOutlineLevel)
+        :   GroupPrimitive2D(rChildren),
+            mnOutlineLevel(nOutlineLevel)
+        {
+        }
+
+        bool TextHierarchyParagraphPrimitive2D::operator==(const 
BasePrimitive2D& rPrimitive) const
         {
+            if(GroupPrimitive2D::operator==(rPrimitive))
+            {
+                const TextHierarchyParagraphPrimitive2D& rCompare = 
static_cast<const TextHierarchyParagraphPrimitive2D&>(rPrimitive);
+
+                return (getOutlineLevel() == rCompare.getOutlineLevel());
+            }
+
+            return false;
         }
 
         // provide unique ID
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d862fabf9fce..bbc7d80361a7 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -69,6 +69,9 @@
 // for StructureTagPrimitive support in sd's unomodel.cxx
 #include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
 
+// for support of Title/Description in all apps when embedding pictures
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+
 using namespace com::sun::star;
 
 // #112245# definition for maximum allowed point count due to Metafile target.
@@ -561,7 +564,8 @@ namespace drawinglayer
             mnSvtGraphicFillCount(0),
             mnSvtGraphicStrokeCount(0),
             mfCurrentUnifiedTransparence(0.0),
-            mpPDFExtOutDevData(dynamic_cast< vcl::PDFExtOutDevData* 
>(rOutDev.GetExtOutDevData()))
+            mpPDFExtOutDevData(dynamic_cast< vcl::PDFExtOutDevData* 
>(rOutDev.GetExtOutDevData())),
+            mnCurrentOutlineLevel(-1)
         {
             OSL_ENSURE(rOutDev.GetConnectMetaFile(), "VclMetafileProcessor2D: 
Used on OutDev which has no MetaFile Target (!)");
             // draw to logic coordinates, do not initialize 
maCurrentTransformation to viewTransformation
@@ -900,6 +904,11 @@ namespace drawinglayer
                     RenderEpsPrimitive2D(static_cast< const 
primitive2d::EpsPrimitive2D& >(rCandidate));
                     break;
                 }
+                case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D :
+                {
+                    RenderObjectInfoPrimitive2D(static_cast< const 
primitive2d::ObjectInfoPrimitive2D& >(rCandidate));
+                    break;
+                }
                 default :
                 {
                     // process recursively
@@ -993,10 +1002,48 @@ namespace drawinglayer
                         sal_Int32(ceil(aCropRange.getMaxX())), 
sal_Int32(ceil(aCropRange.getMaxY())));
                 }
 
+                // Create image alternative description from 
ObjectInfoPrimitive2D info
+                // for PDF export
+                if(mpPDFExtOutDevData->GetIsExportTaggedPDF() && nullptr != 
getObjectInfoPrimitive2D())
+                {
+                    OUString 
aAlternateDescription(getObjectInfoPrimitive2D()->getName());
+
+                    if(!getObjectInfoPrimitive2D()->getTitle().isEmpty())
+                    {
+                        if(!aAlternateDescription.isEmpty())
+                        {
+                            aAlternateDescription += OUString(" - ");
+                        }
+
+                        aAlternateDescription += 
getObjectInfoPrimitive2D()->getTitle();
+                    }
+
+                    if(!getObjectInfoPrimitive2D()->getDesc().isEmpty())
+                    {
+                        if(!aAlternateDescription.isEmpty())
+                        {
+                            aAlternateDescription += OUString(" - ");
+                        }
+
+                        aAlternateDescription += 
getObjectInfoPrimitive2D()->getDesc();
+                    }
+
+                    // Use SetAlternateText to set it. This will work as long 
as some
+                    // structure is used (see PDFWriterImpl::setAlternateText 
and
+                    // m_nCurrentStructElement - tagged PDF export works with 
this in
+                    // Draw/Impress/Writer, but not in Calc due to too less 
structure...)
+                    //Z maybe add structure to Calc PDF export, may need some 
BeginGroup/EndGroup stuff ..?
+                    if(!aAlternateDescription.isEmpty())
+                    {
+                        
mpPDFExtOutDevData->SetAlternateText(aAlternateDescription);
+                    }
+                }
+
                 // #i123295# 3rd param is uncropped rect, 4th is cropped. The 
primitive has the cropped
                 // object transformation, thus aCurrentRect *is* the clip 
region while aCropRect is the expanded,
                 // uncropped region. Thus, correct order is aCropRect, 
aCurrentRect
-                
mpPDFExtOutDevData->EndGroup(rGraphicPrimitive.getGraphicObject().GetGraphic(),
+                mpPDFExtOutDevData->EndGroup(
+                    rGraphicPrimitive.getGraphicObject().GetGraphic(),
                     rAttr.GetTransparency(),
                     aCropRect,
                     aCurrentRect);
@@ -1195,22 +1242,85 @@ namespace drawinglayer
         void 
VclMetafileProcessor2D::processTextHierarchyParagraphPrimitive2D(const 
primitive2d::TextHierarchyParagraphPrimitive2D& rParagraphPrimitive)
         {
             const OString aCommentString("XTEXT_EOP");
+            static bool bSuppressPDFExtOutDevDataSupport(false);
 
-            if(mpPDFExtOutDevData)
+            if(nullptr == mpPDFExtOutDevData || 
bSuppressPDFExtOutDevDataSupport)
             {
-                // emulate data handling from ImpEditEngine::Paint
+                // Non-PDF export behaviour (metafile only).
+                // Process recursively and add MetaFile comment.
+                process(rParagraphPrimitive);
+                mpMetaFile->AddAction(new MetaCommentAction(aCommentString));
+                return;
+            }
+
+            if(!mpPDFExtOutDevData->GetIsExportTaggedPDF())
+            {
+                // No Tagged PDF -> Dump as Paragraph
+                // Emulate data handling from old ImpEditEngine::Paint
                 mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::Paragraph );
+
+                // Process recursively and add MetaFile comment
+                process(rParagraphPrimitive);
+                mpMetaFile->AddAction(new MetaCommentAction(aCommentString));
+
+                // Emulate data handling from ImpEditEngine::Paint
+                mpPDFExtOutDevData->EndStructureElement();
+                return;
             }
 
-            // process recursively and add MetaFile comment
+            // Create Tagged PDF -> deeper tagged data using StructureElements.
+            // Use OutlineLevel from ParagraphPrimitive, ensure not below -1 
what
+            // means 'not active'
+            const sal_Int16 
nNewOutlineLevel(std::max(static_cast<sal_Int16>(-1), 
rParagraphPrimitive.getOutlineLevel()));
+
+            // Do we have a change in OutlineLevel compared to the current one?
+            if(nNewOutlineLevel != mnCurrentOutlineLevel)
+            {
+                if(nNewOutlineLevel > mnCurrentOutlineLevel)
+                {
+                    // increase List level
+                    for(sal_Int16 a(mnCurrentOutlineLevel); a != 
nNewOutlineLevel; a++)
+                    {
+                        mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::List );
+                    }
+                }
+                else // if(nNewOutlineLevel < mnCurrentOutlineLevel)
+                {
+                    // decrease List level
+                    for(sal_Int16 a(mnCurrentOutlineLevel); a != 
nNewOutlineLevel; a--)
+                    {
+                        mpPDFExtOutDevData->EndStructureElement();
+                    }
+                }
+
+                // Remember new current OutlineLevel
+                mnCurrentOutlineLevel = nNewOutlineLevel;
+            }
+
+            const bool bDumpAsListItem(-1 != mnCurrentOutlineLevel);
+
+            if(bDumpAsListItem)
+            {
+                // Dump as ListItem
+                mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::ListItem );
+                mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::LIBody );
+            }
+            else
+            {
+                // Dump as Paragraph
+                mpPDFExtOutDevData->BeginStructureElement( 
vcl::PDFWriter::Paragraph );
+            }
+
+            // Process recursively and add MetaFile comment
             process(rParagraphPrimitive);
             mpMetaFile->AddAction(new MetaCommentAction(aCommentString));
 
-            if(mpPDFExtOutDevData)
+            if(bDumpAsListItem)
             {
-                // emulate data handling from ImpEditEngine::Paint
                 mpPDFExtOutDevData->EndStructureElement();
             }
+
+            mpPDFExtOutDevData->EndStructureElement();
         }
 
         void 
VclMetafileProcessor2D::processTextHierarchyBlockPrimitive2D(const 
primitive2d::TextHierarchyBlockPrimitive2D& rBlockPrimitive)
@@ -2163,12 +2273,38 @@ namespace drawinglayer
         {
             // structured tag primitive
             const vcl::PDFWriter::StructElement& 
rTagElement(rStructureTagCandidate.getStructureElement());
-            const bool bTagUsed(vcl::PDFWriter::NonStructElement != 
rTagElement);
+            bool bTagUsed(vcl::PDFWriter::NonStructElement != rTagElement);
+
+            //Z For now, just do not create StructureTag(s) for 
hidden/background
+            // (Graphic)Objects - see '/Artifact' comments below
+            if(bTagUsed && rStructureTagCandidate.isBackground())
+            {
+                bTagUsed = false;
+            }
 
             if(mpPDFExtOutDevData &&  bTagUsed)
             {
                 // write start tag
                 mpPDFExtOutDevData->BeginStructureElement(rTagElement);
+
+                // if(rStructureTagCandidate.isBackground())
+                // {
+                //     //Z need to somehow apply '/Artifact' information...
+                //     // - Already experimented with adding two 
BeginStructureElement adding
+                //     //   a 'vcl::PDFWriter::Artifact' -> not really what 
e.g. PAC3 expects.
+                //     // - May also be adding someting using 
'SetStructureAttribute' and
+                //     //   extending vcl::PDFWriter::StructAttribute...
+                //     // - Simple solution for now (see above): Just do not 
create
+                //     //   StructureTag(s) for hidden/background 
(Graphic)Objects. That
+                //     //   works, shows all content in PDF renderers, but 
hides in
+                //     //   TaggedStructure. But: also not visible in PAC3's 
'LogicalStructure'
+                //     //   View where there is a tab for 'Artifacts' - I 
*guess* a correctly
+                //     //   tagged '/Artifact' should appear there.
+                //     // Unfortunately found no real example - there is 
https://www.w3.org/TR/WCAG20-TECHS/PDF4.html
+                //     // which claims to have an example in
+                //     // 
https://www.w3.org/WAI/WCAG20/Techniques/working-examples/PDF4/decorative-image.docx
+                //     // but that file has no '/Artifact' entries at all...
+                // }
             }
 
             // process children normally
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx 
b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
index 65007b487727..a897d17ddfff 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.hxx
@@ -169,6 +169,12 @@ namespace drawinglayer
              */
             vcl::PDFExtOutDevData*              mpPDFExtOutDevData;
 
+            // Remember the current OutlineLevel. This is used when tagged PDF 
export
+            // is used to create/write valid structued list entries using PDF 
statements
+            // like '/L', '/LI', 'LBody' instead of simple '/P' (Paragraph).
+            // The value -1 means 'no OutlineLevel' and values >= 0 express 
the level.
+            sal_Int16                           mnCurrentOutlineLevel;
+
         protected:
             /*  the local processor for BasePrimitive2D-Implementation based 
primitives,
                 called from the common process()-implementation
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index df0b95b7cdec..caa481182032 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -61,6 +61,9 @@
 #include <basegfx/polygon/b2dpolygonclipper.hxx>
 #include <basegfx/polygon/b2dtrapezoid.hxx>
 
+// for support of Title/Description in all apps when embedding pictures
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+
 using namespace com::sun::star;
 
 namespace
@@ -1200,6 +1203,19 @@ namespace drawinglayer
             }
         }
 
+        void VclProcessor2D::RenderObjectInfoPrimitive2D(const 
primitive2d::ObjectInfoPrimitive2D& rObjectInfoPrimitive2D)
+        {
+            // remember current ObjectInfoPrimitive2D and set new current one 
(build a stack - push)
+            const primitive2d::ObjectInfoPrimitive2D* 
pLast(getObjectInfoPrimitive2D());
+            mpObjectInfoPrimitive2D = &rObjectInfoPrimitive2D;
+
+            // process content
+            process(rObjectInfoPrimitive2D.getChildren());
+
+            // restore current ObjectInfoPrimitive2D (pop)
+            mpObjectInfoPrimitive2D = pLast;
+        }
+
         void VclProcessor2D::RenderSvgLinearAtomPrimitive2D(const 
primitive2d::SvgLinearAtomPrimitive2D& rCandidate)
         {
             const double fDelta(rCandidate.getOffsetB() - 
rCandidate.getOffsetA());
@@ -1426,7 +1442,8 @@ namespace drawinglayer
             maBColorModifierStack(),
             maCurrentTransformation(),
             maDrawinglayerOpt(),
-            mnPolygonStrokePrimitive2D(0)
+            mnPolygonStrokePrimitive2D(0),
+            mpObjectInfoPrimitive2D(nullptr)
         {
             // set digit language, derived from SvtCTLOptions to have the 
correct
             // number display for arabic/hindi numerals
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx 
b/drawinglayer/source/processor2d/vclprocessor2d.hxx
index beb6146f1535..84e7c524c091 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx
@@ -51,6 +51,7 @@ namespace drawinglayer { namespace primitive2d {
     class ControlPrimitive2D;
     class PagePreviewPrimitive2D;
     class EpsPrimitive2D;
+    class ObjectInfoPrimitive2D;
     class SvgLinearAtomPrimitive2D;
     class SvgRadialAtomPrimitive2D;
 }}
@@ -86,9 +87,10 @@ namespace drawinglayer
             // PolygonStrokePrimitive2D's decompositions (normally only one)
             sal_uInt32                                              
mnPolygonStrokePrimitive2D;
 
+            // currently used ObjectInfoPrimitive2D
+            const primitive2d::ObjectInfoPrimitive2D*               
mpObjectInfoPrimitive2D;
 
             // common VCL rendering support
-
             void RenderTextSimpleOrDecoratedPortionPrimitive2D(const 
primitive2d::TextSimplePortionPrimitive2D& rTextCandidate);
             void RenderPolygonHairlinePrimitive2D(const 
primitive2d::PolygonHairlinePrimitive2D& rPolygonCandidate, bool bPixelBased);
             void RenderBitmapPrimitive2D(const primitive2d::BitmapPrimitive2D& 
rBitmapCandidate);
@@ -104,6 +106,7 @@ namespace drawinglayer
             void RenderPointArrayPrimitive2D(const 
primitive2d::PointArrayPrimitive2D& rPointArrayCandidate);
             void RenderPolygonStrokePrimitive2D(const 
primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate);
             void RenderEpsPrimitive2D(const primitive2d::EpsPrimitive2D& 
rEpsPrimitive2D);
+            void RenderObjectInfoPrimitive2D(const 
primitive2d::ObjectInfoPrimitive2D& rObjectInfoPrimitive2D);
             void RenderSvgLinearAtomPrimitive2D(const 
primitive2d::SvgLinearAtomPrimitive2D& rCandidate);
             void RenderSvgRadialAtomPrimitive2D(const 
primitive2d::SvgRadialAtomPrimitive2D& rCandidate);
 
@@ -120,6 +123,9 @@ namespace drawinglayer
 
             // access to Drawinglayer configuration options
             const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { 
return maDrawinglayerOpt; }
+
+            // access to currently used ObjectInfoPrimitive2D
+            const primitive2d::ObjectInfoPrimitive2D* 
getObjectInfoPrimitive2D() const { return mpObjectInfoPrimitive2D; }
         };
     } // end of namespace processor2d
 } // end of namespace drawinglayer
diff --git a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx 
b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
index 28f6aa86978a..b6e9ad94ede8 100644
--- a/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/structuretagprimitive2d.hxx
@@ -48,14 +48,23 @@ namespace drawinglayer
             /// the PDF structure element this grouping represents
             vcl::PDFWriter::StructElement           maStructureElement;
 
+            ///Z flag for background contenht that may be handled as
+            /// Tagged PDF '/Artifact'
+            bool                                    mbBackground;
+
         public:
             /// constructor
             StructureTagPrimitive2D(
                 const vcl::PDFWriter::StructElement& rStructureElement,
+                bool bBackground,
                 const Primitive2DContainer& rChildren);
 
             /// data read access
             const vcl::PDFWriter::StructElement& getStructureElement() const { 
return maStructureElement; }
+            bool isBackground() const { return mbBackground; }
+
+            /// compare operator
+            virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
             /// provide unique ID
             DeclPrimitive2DIDBlock()
diff --git a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx 
b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
index 5234081584a3..5b08106b6912 100644
--- a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx
@@ -86,9 +86,21 @@ namespace drawinglayer
         class DRAWINGLAYER_DLLPUBLIC TextHierarchyParagraphPrimitive2D : 
public GroupPrimitive2D
         {
         private:
+            // outline level of the encapsulated paragraph data.
+            // -1 means no level, >= 0 is the level
+            sal_Int16           mnOutlineLevel;
+
         public:
             /// constructor
-            explicit TextHierarchyParagraphPrimitive2D(const 
Primitive2DContainer& rChildren);
+            explicit TextHierarchyParagraphPrimitive2D(
+                const Primitive2DContainer& rChildren,
+                sal_Int16 nOutlineLevel = -1);
+
+            /// data read access
+            sal_Int16 getOutlineLevel() const { return mnOutlineLevel; }
+
+            /// compare operator
+            virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
             /// provide unique ID
             DeclPrimitive2DIDBlock()
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 416e936c20bc..b8cd7d7b4691 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1806,7 +1806,17 @@ drawinglayer::primitive2d::Primitive2DContainer 
ImplRenderPaintProc::createRedir
                     {
                         // embed Primitive2DSequence in a structure tag 
element for
                         // exactly this purpose (StructureTagPrimitive2D)
-                        const drawinglayer::primitive2d::Primitive2DReference 
xReference(new drawinglayer::primitive2d::StructureTagPrimitive2D(eElement, 
xRetval));
+
+                        //Z
+                        const SdrPage* 
pSdrPage(pObject->getSdrPageFromSdrObject());
+                        const bool bBackground(nullptr != pSdrPage && 
pSdrPage->IsMasterPage());
+
+                        const drawinglayer::primitive2d::Primitive2DReference 
xReference(
+                            new 
drawinglayer::primitive2d::StructureTagPrimitive2D(
+                                eElement,
+                                bBackground,
+                                xRetval));
+
                         xRetval = 
drawinglayer::primitive2d::Primitive2DContainer { xReference };
                     }
                 }
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 750a5b827364..05490ba7960d 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -93,7 +93,7 @@ namespace
         void impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo);
         static drawinglayer::primitive2d::BasePrimitive2D* 
impCheckFieldPrimitive(drawinglayer::primitive2d::BasePrimitive2D* pPrimitive, 
const DrawPortionInfo& rInfo);
         void impFlushTextPortionPrimitivesToLinePrimitives();
-        void impFlushLinePrimitivesToParagraphPrimitives();
+        void impFlushLinePrimitivesToParagraphPrimitives(sal_Int32 nPara);
         void impHandleDrawPortionInfo(const DrawPortionInfo& rInfo);
         void impHandleDrawBulletInfo(const DrawBulletInfo& rInfo);
 
@@ -498,12 +498,21 @@ namespace
         }
     }
 
-    void impTextBreakupHandler::impFlushLinePrimitivesToParagraphPrimitives()
+    void 
impTextBreakupHandler::impFlushLinePrimitivesToParagraphPrimitives(sal_Int32 
nPara)
     {
         // ALWAYS create a paragraph primitive, even when no content was 
added. This is done to
         // have the correct paragraph count even with empty paragraphs. Those 
paragraphs will
         // have an empty sub-PrimitiveSequence.
-        maParagraphPrimitives.push_back(new 
drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(maLinePrimitives));
+        const sal_Int16 nOutlineLevel(nPara >= 0 && nPara < 
mrOutliner.GetParagraphCount()
+            ? 
mrOutliner.GetParaAttribs(nPara).Get(EE_PARA_OUTLLEVEL).GetValue()
+            : -1);
+
+        //Z This basically makes OutlineLevel information available in 
VclMetafileProcessor2D,
+        //Z so may be used similar to 'SetAlternateText' in 
processGraphicPrimitive2D for PDF export
+        maParagraphPrimitives.push_back(
+            new drawinglayer::primitive2d::TextHierarchyParagraphPrimitive2D(
+                maLinePrimitives,
+                nOutlineLevel));
         maLinePrimitives.clear();
     }
 
@@ -518,7 +527,7 @@ namespace
 
         if(rInfo.mbEndOfParagraph)
         {
-            impFlushLinePrimitivesToParagraphPrimitives();
+            impFlushLinePrimitivesToParagraphPrimitives(rInfo.mnPara);
         }
     }
 
@@ -653,7 +662,7 @@ namespace
         if(!maLinePrimitives.empty())
         {
             // collect non-closed paragraphs
-            impFlushLinePrimitivesToParagraphPrimitives();
+            
impFlushLinePrimitivesToParagraphPrimitives(mrOutliner.GetParagraphCount() - 1);
         }
 
         return maParagraphPrimitives;
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6dd910fab9ee..24e4b03f39f0 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -80,6 +80,7 @@
 #include <vcl/pdfextoutdevdata.hxx>
 #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
 
 using namespace com::sun::star;
 
@@ -932,7 +933,10 @@ void paintGraphicUsingPrimitivesHelper(
     vcl::RenderContext & rOutputDevice,
     GraphicObject const& rGrfObj,
     GraphicAttr const& rGraphicAttr,
-    const basegfx::B2DHomMatrix& rGraphicTransform)
+    const basegfx::B2DHomMatrix& rGraphicTransform,
+    const OUString& rName,
+    const OUString& rTitle,
+    const OUString& rDescription)
 {
     // RotGrfFlyFrame: unify using GraphicPrimitive2D
     // -> the primitive handles all crop and mirror stuff
@@ -996,6 +1000,17 @@ void paintGraphicUsingPrimitivesHelper(
         }
     }
 
+    if(!rName.isEmpty() || !rTitle.isEmpty() || !rDescription.isEmpty())
+    {
+        // Embed to ObjectInfoPrimitive2D when we have Name/Title/Description
+        // information available
+        aContent[0] = new drawinglayer::primitive2d::ObjectInfoPrimitive2D(
+            aContent,
+            rName,
+            rTitle,
+            rDescription);
+    }
+
     basegfx::B2DRange aTargetRange(0.0, 0.0, 1.0, 1.0);
     aTargetRange.transform(rGraphicTransform);
 
@@ -1138,7 +1153,10 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* 
pOut, const SwRect &rGrfAr
                         *pOut,
                         rGrfObj,
                         aGrfAttr,
-                        aGraphicTransform);
+                        aGraphicTransform,
+                        nullptr == pGrfNd->GetFlyFormat() ? OUString() : 
pGrfNd->GetFlyFormat()->GetName(),
+                        rNoTNd.GetTitle(),
+                        rNoTNd.GetDescription());
                 }
             }
             else
@@ -1226,7 +1244,10 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* 
pOut, const SwRect &rGrfAr
                     *pOut,
                     aTempGraphicObject,
                     aGrfAttr,
-                    aGraphicTransform);
+                    aGraphicTransform,
+                    nullptr == pGrfNd->GetFlyFormat() ? OUString() : 
pGrfNd->GetFlyFormat()->GetName(),
+                    rNoTNd.GetTitle(),
+                    rNoTNd.GetDescription());
 
                 // shade the representation if the object is activated outplace
                 uno::Reference < embed::XEmbeddedObject > xObj = 
pOLENd->GetOLEObj().GetOleRef();
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 0ffe4a75c0f6..5ecdc3bfc5d0 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -77,7 +77,10 @@ void paintGraphicUsingPrimitivesHelper(
     OutputDevice & rOutputDevice,
     GraphicObject const& rGraphicObj,
     GraphicAttr const& rGraphicAttr,
-    const basegfx::B2DHomMatrix& rGraphicTransform);
+    const basegfx::B2DHomMatrix& rGraphicTransform,
+    const OUString& rName,
+    const OUString& rTitle,
+    const OUString& rDescription);
 
 // method to align rectangle.
 // Created declaration here to avoid <extern> declarations
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index b684232ba78d..ee707b0e41dd 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1676,7 +1676,10 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, 
vcl::RenderContext *pOu
         *pOut,
         *pGrf,
         pGrf->GetAttr(),
-        aGraphicTransform);
+        aGraphicTransform,
+        OUString(),
+        OUString(),
+        OUString());
 
     if ( bNotInside )
         pOut->Pop();
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index d171a5fbef80..2f40cd796fc6 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -486,7 +486,6 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
         bool bEndIndent = false;
         bool bTextIndent = false;
         bool bTextAlign = false;
-        bool bAlternateText = false;
         bool bWidth = false;
         bool bHeight = false;
         bool bBox = false;
@@ -550,7 +549,6 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
             case vcl::PDFWriter::Formula :
             case vcl::PDFWriter::Figure :
                 bPlacement =
-                bAlternateText =
                 bWidth =
                 bHeight =
                 bBox = true;
@@ -640,19 +638,9 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
             }
         }
 
-        if ( bAlternateText )
-        {
-            OSL_ENSURE( pFrame->IsFlyFrame(), "Frame type <-> tag attribute 
mismatch" );
-            const SwFlyFrame* pFly = static_cast<const SwFlyFrame*>(pFrame);
-            if ( pFly->Lower() && pFly->Lower()->IsNoTextFrame() )
-            {
-                const SwNoTextFrame* pNoTextFrame   = static_cast<const 
SwNoTextFrame*>(pFly->Lower());
-                const SwNoTextNode* pNoTextNode = static_cast<const 
SwNoTextNode*>(pNoTextFrame->GetNode());
-
-                const OUString aAlternateText( pNoTextNode->GetTitle() );
-                mpPDFExtOutDevData->SetAlternateText( aAlternateText );
-            }
-        }
+        // Formally here bAlternateText was triggered for PDF export, but this
+        // was moved for more general use to primitives and usage in
+        // VclMetafileProcessor2D (see processGraphicPrimitive2D).
 
         if ( bWidth )
         {
commit 0cc4c482089ff9dcb71278eb931a5a7e0ccd8349
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Jul 31 15:33:43 2018 +0100
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Tue Mar 12 22:24:47 2019 +0100

    crashtesting: stack exhaustion exporting moz1253590-2.svg to odg
    
    happens on the crashtesting box, but not locally, comparing the stack 
frames its clear
    that the stack used on the crashtester for 
VclPixelProcessor2D::processBasePrimitive2D is
    over double that used locally...
    
    comparison on
    > objdump -S 
workdir/CxxObject/drawinglayer/source/processor2d/vclmetafileprocessor2d.o |less
    gives...
    void VclMetafileProcessor2D::processBasePrimitive2D(const 
primitive2d::BasePrimitive2D& rCandidate)
    gcc-4.8.2-3.2.mga4 has...       sub    $0x5b0,%rsp
    vs...
    gcc-8.1.1-5.fc28.x86_64 has...  sub    $0x2e0,%rsp
    
    lets split up this method
    
    Change-Id: I6d84f555a01b5c58f530adb9b9b8cb8803c985bf
    Reviewed-on: https://gerrit.libreoffice.org/58364
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>
    (cherry picked from commit aa2e694e8d9e22de94dbf21f81883f9af0e34ce9)

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index aae85f6d0e06..bc234adc8337 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -285,113 +285,28 @@ namespace drawinglayer
             {
                 case PRIMITIVE2D_ID_WRONGSPELLPRIMITIVE2D :
                 {
-                    // directdraw of wrong spell primitive; added test 
possibility to check wrong spell decompose
-                    static bool bHandleWrongSpellDirectly(true);
-
-                    if(bHandleWrongSpellDirectly)
-                    {
-                        const primitive2d::WrongSpellPrimitive2D& 
rWrongSpellPrimitive = static_cast< const primitive2d::WrongSpellPrimitive2D& 
>(rCandidate);
-
-                        if(!renderWrongSpellPrimitive2D(
-                            rWrongSpellPrimitive,
-                            *mpOutputDevice,
-                            maCurrentTransformation,
-                            maBColorModifierStack))
-                        {
-                            // fallback to decomposition (MetaFile)
-                            process(rWrongSpellPrimitive);
-                        }
-                    }
-                    else
-                    {
-                        process(rCandidate);
-                    }
+                    processWrongSpellPrimitive2D(static_cast<const 
primitive2d::WrongSpellPrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D :
                 {
-                    // directdraw of text simple portion; added test 
possibility to check text decompose
-                    static bool bForceSimpleTextDecomposition(false);
-
-                    // Adapt evtl. used special DrawMode
-                    const DrawModeFlags 
nOriginalDrawMode(mpOutputDevice->GetDrawMode());
-                    adaptTextToFillDrawMode();
-
-                    if(!bForceSimpleTextDecomposition && 
getOptionsDrawinglayer().IsRenderSimpleTextDirect())
-                    {
-                        
RenderTextSimpleOrDecoratedPortionPrimitive2D(static_cast< const 
primitive2d::TextSimplePortionPrimitive2D& >(rCandidate));
-                    }
-                    else
-                    {
-                        process(rCandidate);
-                    }
-
-                    // restore DrawMode
-                    mpOutputDevice->SetDrawMode(nOriginalDrawMode);
-
+                    processTextSimplePortionPrimitive2D(static_cast<const 
primitive2d::TextSimplePortionPrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D :
                 {
-                    // directdraw of decorated text portion; added test 
possibility to check text decompose
-                    static bool bForceComplexTextDecomposition(false);
-
-                    // Adapt evtl. used special DrawMode
-                    const DrawModeFlags 
nOriginalDrawMode(mpOutputDevice->GetDrawMode());
-                    adaptTextToFillDrawMode();
-
-                    if(!bForceComplexTextDecomposition && 
getOptionsDrawinglayer().IsRenderDecoratedTextDirect())
-                    {
-                        
RenderTextSimpleOrDecoratedPortionPrimitive2D(static_cast< const 
primitive2d::TextSimplePortionPrimitive2D& >(rCandidate));
-                    }
-                    else
-                    {
-                        process(rCandidate);
-                    }
-
-                    // restore DrawMode
-                    mpOutputDevice->SetDrawMode(nOriginalDrawMode);
-
+                    processTextDecoratedPortionPrimitive2D(static_cast<const 
primitive2d::TextSimplePortionPrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D :
                 {
-                    // try to use directly
-                    const primitive2d::PolygonHairlinePrimitive2D& 
rPolygonHairlinePrimitive2D = static_cast< const 
primitive2d::PolygonHairlinePrimitive2D& >(rCandidate);
-                    static bool bAllowed(true);
-
-                    if(bAllowed && 
tryDrawPolygonHairlinePrimitive2DDirect(rPolygonHairlinePrimitive2D, 0.0))
-                    {
-                        break;
-                    }
-
-                    // direct draw of hairline
-                    
RenderPolygonHairlinePrimitive2D(rPolygonHairlinePrimitive2D, true);
+                    processPolygonHairlinePrimitive2D(static_cast<const 
primitive2d::PolygonHairlinePrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D :
                 {
                     // direct draw of transformed BitmapEx primitive
-                    const primitive2d::BitmapPrimitive2D& rBitmapCandidate = 
static_cast< const primitive2d::BitmapPrimitive2D& >(rCandidate);
-
-                    // check if graphic content is inside discrete local 
ViewPort
-                    const basegfx::B2DRange& 
rDiscreteViewPort(getViewInformation2D().getDiscreteViewport());
-                    const basegfx::B2DHomMatrix 
aLocalTransform(maCurrentTransformation * rBitmapCandidate.getTransform());
-
-                    if(!rDiscreteViewPort.isEmpty())
-                    {
-                        basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
-
-                        aUnitRange.transform(aLocalTransform);
-
-                        if(!aUnitRange.overlaps(rDiscreteViewPort))
-                        {
-                            // content is outside discrete local ViewPort
-                            break;
-                        }
-                    }
-
-                    RenderBitmapPrimitive2D(static_cast< const 
primitive2d::BitmapPrimitive2D& >(rCandidate));
+                    processBitmapPrimitive2D(static_cast<const 
primitive2d::BitmapPrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_FILLGRAPHICPRIMITIVE2D :
@@ -402,30 +317,7 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_POLYPOLYGONGRADIENTPRIMITIVE2D :
                 {
-                    // direct draw of gradient
-                    const primitive2d::PolyPolygonGradientPrimitive2D& 
rPolygonCandidate = static_cast< const 
primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate);
-                    const attribute::FillGradientAttribute& 
rGradient(rPolygonCandidate.getFillGradient());
-                    basegfx::BColor 
aStartColor(maBColorModifierStack.getModifiedColor(rGradient.getStartColor()));
-                    basegfx::BColor 
aEndColor(maBColorModifierStack.getModifiedColor(rGradient.getEndColor()));
-                    basegfx::B2DPolyPolygon 
aLocalPolyPolygon(rPolygonCandidate.getB2DPolyPolygon());
-
-                    if(aLocalPolyPolygon.count())
-                    {
-                        aLocalPolyPolygon.transform(maCurrentTransformation);
-
-                        if(aStartColor == aEndColor)
-                        {
-                            // no gradient at all, draw as polygon in AA and 
non-AA case
-                            mpOutputDevice->SetLineColor();
-                            mpOutputDevice->SetFillColor(Color(aStartColor));
-                            mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
-                        }
-                        else
-                        {
-                            // use the primitive decomposition of the metafile
-                            process(rPolygonCandidate);
-                        }
-                    }
+                    processPolyPolygonGradientPrimitive2D(static_cast<const 
primitive2d::PolyPolygonGradientPrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_POLYPOLYGONGRAPHICPRIMITIVE2D :
@@ -436,74 +328,12 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D :
                 {
-                    // try to use directly
-                    const primitive2d::PolyPolygonColorPrimitive2D& 
rPolyPolygonColorPrimitive2D = static_cast< const 
primitive2d::PolyPolygonColorPrimitive2D& >(rCandidate);
-                    basegfx::B2DPolyPolygon aLocalPolyPolygon;
-                    static bool bAllowed(true);
-
-                    if(bAllowed)
-                    {
-                        
tryDrawPolyPolygonColorPrimitive2DDirect(rPolyPolygonColorPrimitive2D, 0.0);
-                        // okay, done. In this case no gaps should have to be 
repaired, too
-                    }
-                    else
-                    {
-                        // direct draw of tools::PolyPolygon with color
-                        const basegfx::BColor 
aPolygonColor(maBColorModifierStack.getModifiedColor(rPolyPolygonColorPrimitive2D.getBColor()));
-
-                        mpOutputDevice->SetFillColor(Color(aPolygonColor));
-                        mpOutputDevice->SetLineColor();
-                        aLocalPolyPolygon = 
rPolyPolygonColorPrimitive2D.getB2DPolyPolygon();
-                        aLocalPolyPolygon.transform(maCurrentTransformation);
-                        mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
-                    }
-
-                    // when AA is on and this filled polygons are the result 
of stroked line geometry,
-                    // draw the geometry once extra as lines to avoid AA 
'gaps' between partial polygons
-                    // Caution: This is needed in both cases (!)
-                    if(mnPolygonStrokePrimitive2D
-                        && getOptionsDrawinglayer().IsAntiAliasing()
-                        && (mpOutputDevice->GetAntialiasing() & 
AntialiasingFlags::EnableB2dDraw))
-                    {
-                        const basegfx::BColor 
aPolygonColor(maBColorModifierStack.getModifiedColor(rPolyPolygonColorPrimitive2D.getBColor()));
-                        sal_uInt32 nCount(aLocalPolyPolygon.count());
-
-                        if(!nCount)
-                        {
-                            aLocalPolyPolygon = 
rPolyPolygonColorPrimitive2D.getB2DPolyPolygon();
-                            
aLocalPolyPolygon.transform(maCurrentTransformation);
-                            nCount = aLocalPolyPolygon.count();
-                        }
-
-                        mpOutputDevice->SetFillColor();
-                        mpOutputDevice->SetLineColor(Color(aPolygonColor));
-
-                        for(sal_uInt32 a(0); a < nCount; a++)
-                        {
-                            
mpOutputDevice->DrawPolyLine(aLocalPolyPolygon.getB2DPolygon(a), 0.0);
-                        }
-                    }
-
+                    processPolyPolygonColorPrimitive2D(static_cast<const 
primitive2d::PolyPolygonColorPrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
                 {
-                    // #i98289#
-                    const bool 
bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && 
getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
-                    const AntialiasingFlags 
nOldAntiAliase(mpOutputDevice->GetAntialiasing());
-
-                    if(bForceLineSnap)
-                    {
-                        mpOutputDevice->SetAntialiasing(nOldAntiAliase | 
AntialiasingFlags::PixelSnapHairline);
-                    }
-
-                    process(rCandidate);
-
-                    if(bForceLineSnap)
-                    {
-                        mpOutputDevice->SetAntialiasing(nOldAntiAliase);
-                    }
-
+                    processMetaFilePrimitive2D(rCandidate);
                     break;
                 }
                 case PRIMITIVE2D_ID_MASKPRIMITIVE2D :
@@ -520,91 +350,7 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D :
                 {
-                    // Detect if a single PolyPolygonColorPrimitive2D is 
contained; in that case,
-                    // use the faster OutputDevice::DrawTransparent method
-                    const primitive2d::UnifiedTransparencePrimitive2D& 
rUniTransparenceCandidate = static_cast< const 
primitive2d::UnifiedTransparencePrimitive2D& >(rCandidate);
-                    const primitive2d::Primitive2DContainer& rContent = 
rUniTransparenceCandidate.getChildren();
-
-                    if(!rContent.empty())
-                    {
-                        if(0.0 == rUniTransparenceCandidate.getTransparence())
-                        {
-                            // not transparent at all, use content
-                            process(rUniTransparenceCandidate.getChildren());
-                        }
-                        else if(rUniTransparenceCandidate.getTransparence() > 
0.0 && rUniTransparenceCandidate.getTransparence() < 1.0)
-                        {
-                            bool bDrawTransparentUsed(false);
-
-                            // since DEV300 m33 DrawTransparent is supported 
in VCL (for some targets
-                            // natively), so i am now enabling this shortcut
-                            static bool bAllowUsingDrawTransparent(true);
-
-                            if(bAllowUsingDrawTransparent && 1 == 
rContent.size())
-                            {
-                                const primitive2d::Primitive2DReference 
xReference(rContent[0]);
-                                const primitive2d::BasePrimitive2D* 
pBasePrimitive = dynamic_cast< const primitive2d::BasePrimitive2D* 
>(xReference.get());
-
-                                if(pBasePrimitive)
-                                {
-                                    switch(pBasePrimitive->getPrimitive2DID())
-                                    {
-                                        case 
PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D:
-                                        {
-                                            // single transparent 
tools::PolyPolygon identified, use directly
-                                            const 
primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = static_cast< const 
primitive2d::PolyPolygonColorPrimitive2D* >(pBasePrimitive);
-                                            OSL_ENSURE(pPoPoColor, "OOps, 
PrimitiveID and PrimitiveType do not match (!)");
-                                            bDrawTransparentUsed = true;
-                                            
tryDrawPolyPolygonColorPrimitive2DDirect(*pPoPoColor, 
rUniTransparenceCandidate.getTransparence());
-                                            break;
-                                        }
-                                        case 
PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D:
-                                        {
-                                            // single transparent 
PolygonHairlinePrimitive2D identified, use directly
-                                            const 
primitive2d::PolygonHairlinePrimitive2D* pPoHair = static_cast< const 
primitive2d::PolygonHairlinePrimitive2D* >(pBasePrimitive);
-                                            OSL_ENSURE(pPoHair, "OOps, 
PrimitiveID and PrimitiveType do not match (!)");
-
-                                            // do no tallow by default - 
problem is that self-overlapping parts of this geometry will
-                                            // not be in a all-same 
transparency but will already alpha-cover themselves with blending.
-                                            // This is not what the 
UnifiedTransparencePrimitive2D defines: It requires all its
-                                            // content to be uniformely 
transparent.
-                                            // For hairline the effect is 
pretty minimal, but still not correct.
-                                            static bool bAllowed(false);
-
-                                            bDrawTransparentUsed = bAllowed && 
tryDrawPolygonHairlinePrimitive2DDirect(*pPoHair, 
rUniTransparenceCandidate.getTransparence());
-                                            break;
-                                        }
-                                        case 
PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D:
-                                        {
-                                            // single transparent 
PolygonStrokePrimitive2D identified, use directly
-                                            const 
primitive2d::PolygonStrokePrimitive2D* pPoStroke = static_cast< const 
primitive2d::PolygonStrokePrimitive2D* >(pBasePrimitive);
-                                            OSL_ENSURE(pPoStroke, "OOps, 
PrimitiveID and PrimitiveType do not match (!)");
-
-                                            // do no tallow by default - 
problem is that self-overlapping parts of this geometry will
-                                            // not be in a all-same 
transparency but will already alpha-cover themselves with blending.
-                                            // This is not what the 
UnifiedTransparencePrimitive2D defines: It requires all its
-                                            // content to be uniformely 
transparent.
-                                            // To check, activate and draw a 
wide transparent self-crossing line/curve
-                                            static bool bAllowed(false);
-
-                                            bDrawTransparentUsed = bAllowed && 
tryDrawPolygonStrokePrimitive2DDirect(*pPoStroke, 
rUniTransparenceCandidate.getTransparence());
-                                            break;
-                                        }
-                                    default:
-                                        SAL_INFO("drawinglayer", "default case 
for " << drawinglayer::primitive2d::idToString(rCandidate.getPrimitive2DID()));
-                                        break;
-                                    }
-                                }
-                            }
-
-                            if(!bDrawTransparentUsed)
-                            {
-                                // unified sub-transparence. Draw to VDev 
first.
-                                
RenderUnifiedTransparencePrimitive2D(rUniTransparenceCandidate);
-                            }
-                        }
-                    }
-
+                    processUnifiedTransparencePrimitive2D(static_cast<const 
primitive2d::UnifiedTransparencePrimitive2D&>(rCandidate));
                     break;
                 }
                 case PRIMITIVE2D_ID_TRANSPARENCEPRIMITIVE2D :
@@ -639,199 +385,22 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_CONTROLPRIMITIVE2D :
                 {
-                    // control primitive
-                    const primitive2d::ControlPrimitive2D& rControlPrimitive = 
static_cast< const primitive2d::ControlPrimitive2D& >(rCandidate);
-                    const uno::Reference< awt::XControl >& 
rXControl(rControlPrimitive.getXControl());
-
-                    try
-                    {
-                        // remember old graphics and create new
-                        uno::Reference< awt::XView > xControlView(rXControl, 
uno::UNO_QUERY_THROW);
-                        const uno::Reference< awt::XGraphics > 
xOriginalGraphics(xControlView->getGraphics());
-                        const uno::Reference< awt::XGraphics > 
xNewGraphics(mpOutputDevice->CreateUnoGraphics());
-
-                        if(xNewGraphics.is())
-                        {
-                            // link graphics and view
-                            xControlView->setGraphics(xNewGraphics);
-
-                            // get position
-                            const basegfx::B2DHomMatrix 
aObjectToPixel(maCurrentTransformation * rControlPrimitive.getTransform());
-                            const basegfx::B2DPoint 
aTopLeftPixel(aObjectToPixel * basegfx::B2DPoint(0.0, 0.0));
-
-                            // find out if the control is already visualized 
as a VCL-ChildWindow. If yes,
-                            // it does not need to be painted at all.

... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to