sc/source/filter/oox/pagesettings.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 70462f044ccd7c081ba7f758c359efe820af148c
Author:     seyoufi22 <[email protected]>
AuthorDate: Tue Feb 10 12:04:48 2026 +0200
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Thu Feb 12 09:32:04 2026 +0100

    tdf#48140 Remove UNO Calls from pagesettings.cxx
    
    Change-Id: I734bc39d24186bd3d34ce5d395f3886adb13af76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199045
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sc/source/filter/oox/pagesettings.cxx 
b/sc/source/filter/oox/pagesettings.cxx
index 34062acd893f..b8532aeb5eae 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -22,7 +22,6 @@
 #include <algorithm>
 #include <set>
 #include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/container/XNamed.hpp>
 #include <com/sun/star/sheet/XHeaderFooterContent.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
 #include <com/sun/star/style/GraphicLocation.hpp>
@@ -319,9 +318,10 @@ void PageSettings::setFitToPagesMode( bool bFitToPages )
 void PageSettings::finalizeImport()
 {
     OUStringBuffer aStyleNameBuffer( "PageStyle_" );
-    Reference<container::XNamed> xSheetName(getSheet(), UNO_QUERY);
-    if( xSheetName.is() )
-        aStyleNameBuffer.append( xSheetName->getName() );
+    ScDocument& rDoc = getScDocument();
+    OUString aSheetName;
+    if(rDoc.GetName(getSheetIndex(), aSheetName))
+        aStyleNameBuffer.append(aSheetName);
     else
         aStyleNameBuffer.append( static_cast< sal_Int32 >( getSheetIndex() + 1 
) );
     OUString aStyleName = aStyleNameBuffer.makeStringAndClear();
@@ -332,7 +332,7 @@ void PageSettings::finalizeImport()
 
     // Set page style name to the sheet.
     SCTAB nTab = getSheetIndex();
-    getScDocument().SetPageStyle(nTab, aStyleName);
+    rDoc.SetPageStyle(nTab, aStyleName);
 }
 
 void PageSettings::importPictureData( const Relations& rRelations, const 
OUString& rRelId )

Reply via email to