cui/source/tabpages/numpages.cxx                     |    8 ++++++--
 sc/qa/unit/data/ods/tdf142764.ods                    |binary
 sc/qa/unit/subsequent_export-test2.cxx               |   19 +++++++++++++++++++
 sc/source/filter/xml/XMLTableHeaderFooterContext.cxx |   12 +++++++++---
 4 files changed, 34 insertions(+), 5 deletions(-)

New commits:
commit 2de1b879b70535a6c1e7207b4be9271a54e2dfc9
Author:     Daniel Arato (NISZ) <arato.dan...@nisz.hu>
AuthorDate: Thu Jun 24 15:01:54 2021 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jul 7 21:58:25 2021 +0200

    tdf#142764 sc: import "Same content on first/left page"
    
    Different header of the first page was never imported
    (related to the missing UI support), despite its working
    ODF export.
    
    This commit sets the values of those options at ODS file load
    according to the "display" attribute used to hide or show
    a particular header/footer.
    
    Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
    "tdf#121715 XLSX: support custom first page header/footer".
    
    Change-Id: I3409ad94a4d3ff86fd7f6d8afede3e7603024515
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117788
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 52beb3907dd3c7e6ae112e263def1005272cecd8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118501
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/unit/data/ods/tdf142764.ods 
b/sc/qa/unit/data/ods/tdf142764.ods
new file mode 100644
index 000000000000..bbc4355dab32
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf142764.ods differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index 1c088c813f21..47a50a3d8ee6 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -142,6 +142,7 @@ public:
     void testPivotCacheAfterExportXLSX();
     void testTdf114969XLSX();
     void testTdf115192XLSX();
+    void testTdf142764();
     void testTdf91634XLSX();
     void testTdf115159();
     void testTdf112567();
@@ -237,6 +238,7 @@ public:
     CPPUNIT_TEST(testPivotCacheAfterExportXLSX);
     CPPUNIT_TEST(testTdf114969XLSX);
     CPPUNIT_TEST(testTdf115192XLSX);
+    CPPUNIT_TEST(testTdf142764);
     CPPUNIT_TEST(testTdf91634XLSX);
     CPPUNIT_TEST(testTdf115159);
     CPPUNIT_TEST(testTdf112567);
@@ -1211,6 +1213,23 @@ void ScExportTest2::testTdf115192XLSX()
     xDocSh->DoClose();
 }
 
+void ScExportTest2::testTdf142764()
+{
+    ScDocShellRef xShell = loadDoc(u"tdf142764.", FORMAT_ODS);
+    CPPUNIT_ASSERT(xShell);
+
+    auto pXPathFile = ScBootstrapFixture::exportTo(&(*xShell), FORMAT_XLSX);
+
+    xmlDocUniquePtr pSheet
+        = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/worksheets/sheet1.xml");
+    CPPUNIT_ASSERT(pSheet);
+
+    assertXPath(pSheet, "/x:worksheet/x:headerFooter", "differentOddEven", 
"true");
+    assertXPath(pSheet, "/x:worksheet/x:headerFooter", "differentFirst", 
"true");
+
+    xShell->DoClose();
+}
+
 void ScExportTest2::testTdf91634XLSX()
 {
     ScDocShellRef xDocSh = loadDoc(u"image_hyperlink.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx 
b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
index a34015a999cf..c0b5c6eb6cc1 100644
--- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
+++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx
@@ -53,6 +53,7 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
     OUString sContentLeft( bFooter ? OUString(SC_UNO_PAGE_LEFTFTRCONT) : 
OUString(SC_UNO_PAGE_LEFTHDRCONT) );
     OUString sContentFirst( bFooter ? OUString(SC_UNO_PAGE_FIRSTFTRCONT) : 
OUString(SC_UNO_PAGE_FIRSTHDRCONT) );
     OUString sShareContent( bFooter ? OUString(SC_UNO_PAGE_FTRSHARED) : 
OUString(SC_UNO_PAGE_HDRSHARED) );
+    OUString sShareFirstContent( bFooter ? 
OUString(SC_UNO_PAGE_FIRSTFTRSHARED) : OUString(SC_UNO_PAGE_FIRSTHDRSHARED) );
     bool bDisplay( true );
     for( auto &aIter : sax_fastparser::castToFastAttributeList( xAttrList ) )
     {
@@ -61,10 +62,9 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
         else
             XMLOFF_WARN_UNKNOWN("sc", aIter);
     }
+    bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
     if( bLeft )
     {
-        bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
-
         if( bOn && bDisplay )
         {
             if( ::cppu::any2bool(xPropSet->getPropertyValue( sShareContent )) )
@@ -80,16 +80,22 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( 
SvXMLImport& rImport,
     }
     else
     {
-        bool bOn(::cppu::any2bool(xPropSet->getPropertyValue( sOn )));
         if ( bOn != bDisplay )
             xPropSet->setPropertyValue( sOn, uno::makeAny(bDisplay) );
     }
     if (bLeft)
+    {
         sCont = sContentLeft;
+    }
     else if (bFirst)
+    {
         sCont = sContentFirst;
+        xPropSet->setPropertyValue( sShareFirstContent, 
uno::makeAny(!bDisplay) );
+    }
     else
+    {
         sCont = sContent;
+    }
     xPropSet->getPropertyValue( sCont ) >>= xHeaderFooterContent;
 }
 
commit 4dc0c43e29e9825aab731edd77c3fc1cb7566639
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Thu Jul 1 12:16:40 2021 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jul 7 21:58:09 2021 +0200

    tdf#141334 - Only show the last name of the filename without its extension
    
    In the bullets and numbering dialog under customize, don't show the
    filename including its extension in the context menu of the gallery.
    
    Change-Id: Ia3d4277f5b074be78244f0599883f36385a40c8a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118218
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>
    (cherry picked from commit a646ba6e5ed042756feac16b91739203793f1742)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118414
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 32063c6f1c5d..a0d360622d0b 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1884,8 +1884,12 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, 
PopupActivateHdl_Impl, weld::Toggleable&,
         sGrfName = grfName;
         OUString sItemId = "gallery" + OUString::number(i);
         INetURLObject aObj(sGrfName);
-        if(aObj.GetProtocol() == INetProtocol::File)
-            sGrfName = aObj.PathToFileName();
+        if (aObj.GetProtocol() == INetProtocol::File)
+        {
+            // tdf#141334 - only show the last name of the filename without 
its extension
+            aObj.removeExtension();
+            sGrfName = 
aObj.GetLastName(INetURLObject::DecodeMechanism::Unambiguous);
+        }
         if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, i, 
&aGraphic))
         {
             BitmapEx aBitmap(aGraphic.GetBitmapEx());
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to