[Libreoffice-commits] core.git: sc/inc sc/source sw/source

2017-12-21 Thread Katarina Behrens
 sc/inc/unonames.hxx  |1 
 sc/source/ui/unoobj/confuno.cxx  |   30 ++-
 sw/source/uibase/uno/SwXDocumentSettings.cxx |   18 
 sw/source/uibase/uno/SwXDocumentSettings.hxx |1 
 4 files changed, 49 insertions(+), 1 deletion(-)

New commits:
commit 785a8564ebb501e2e623133e214467b947f7e671
Author: Katarina Behrens 
Date:   Mon Nov 27 13:51:55 2017 +0100

tdf#79077: Load/save PapersizeFromSetup into ODF for sw and sc

Change-Id: I0fc1a771927dc7116768cfbb7f7e31006e41e1c8
Reviewed-on: https://gerrit.libreoffice.org/45332
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 6e104542f7dc..f8bf85968615 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -555,6 +555,7 @@
 #define SC_UNO_AUTOCALC "AutoCalculate"
 #define SC_UNO_PRINTERNAME  "PrinterName"
 #define SC_UNO_PRINTERSETUP "PrinterSetup"
+#define SC_UNO_PRINTERPAPER "PrinterPaperFromSetup"
 #define SC_UNO_APPLYDOCINF  "ApplyUserData"
 #define SC_UNO_CHARCOMP "CharacterCompressionType"
 #define SC_UNO_ASIANKERN"IsKernAsianPunctuation"
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index d2afa88c659e..6894813441e4 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -70,6 +70,7 @@ static const SfxItemPropertyMapEntry* 
lcl_GetConfigPropertyMap()
 {OUString(SC_UNO_AUTOCALC), 0,  cppu::UnoType::get(),
  0, 0},
 {OUString(SC_UNO_PRINTERNAME),  0,  cppu::UnoType::get(),
0, 0},
 {OUString(SC_UNO_PRINTERSETUP), 0,  
cppu::UnoType::get(), 0, 0},
+{OUString(SC_UNO_PRINTERPAPER), 0,  cppu::UnoType::get(),
  0, 0},
 {OUString(SC_UNO_APPLYDOCINF),  0,  cppu::UnoType::get(),
  0, 0},
 {OUString(SC_UNO_FORBIDDEN),0,  
cppu::UnoType::get(), 
beans::PropertyAttribute::READONLY, 0},
 {OUString(SC_UNO_CHARCOMP), 0,  cppu::UnoType::get(),   
 0, 0},
@@ -240,7 +241,28 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
 SID_PRINTER_CHANGESTODOC,  SID_PRINTER_CHANGESTODOC,
 SID_PRINT_SELECTEDSHEET,   SID_PRINT_SELECTEDSHEET,
 SID_SCPRINTOPTIONS,SID_SCPRINTOPTIONS>{} );
-pDocShell->SetPrinter( SfxPrinter::Create( aStream, 
std::move(pSet) ) );
+
+SfxPrinter* pPrinter = pDocShell->GetPrinter();
+bool bPreferPrinterPapersize = false;
+if ( pPrinter )
+bPreferPrinterPapersize = 
pPrinter->GetPrinterSettingsPreferred();
+
+VclPtr pTempPrinter = SfxPrinter::Create( aStream, 
std::move(pSet) );
+pTempPrinter->SetPrinterSettingsPreferred( 
bPreferPrinterPapersize );
+pDocShell->SetPrinter( pTempPrinter );
+}
+}
+}
+else if ( aPropertyName == SC_UNO_PRINTERPAPER )
+{
+bool bPreferPrinterPapersize;
+if( aValue >>= bPreferPrinterPapersize )
+{
+if( pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
+{
+SfxPrinter *pTempPrinter = pDocShell->GetPrinter( true );
+if (pTempPrinter)
+pTempPrinter->SetPrinterSettingsPreferred( 
bPreferPrinterPapersize );
 }
 }
 }
@@ -462,6 +484,12 @@ uno::Any SAL_CALL 
ScDocumentConfiguration::getPropertyValue( const OUString& aPr
 else
 aRet <<= uno::Sequence();
 }
+else if ( aPropertyName == SC_UNO_PRINTERPAPER)
+{
+SfxPrinter *pTempPrinter = pDocShell->GetPrinter( false );
+aRet <<= pTempPrinter && pTempPrinter->GetPrinterSettingsPreferred();
+
+}
 else if ( aPropertyName == SC_UNO_APPLYDOCINF )
 aRet <<= pDocShell->IsUseUserData();
 else if ( aPropertyName == SC_UNO_FORBIDDEN )
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx 
b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index ee86063fea52..d7009cd20b26 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -74,6 +74,7 @@ enum SwDocumentSettingsPropertyHandles
 HANDLE_ALIGN_TAB_STOP_POSITION,
 HANDLE_PRINTER_NAME,
 HANDLE_PRINTER_SETUP,
+HANDLE_PRINTER_PAPER,
 HANDLE_IS_KERN_ASIAN_PUNCTUATION,
 HANDLE_CHARACTER_COMPRESSION_TYPE,
 HANDLE_APPLY_USER_DATA,
@@ -150,6 +151,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
 { OUString("AlignTabStopPosition"),   
HANDLE_ALIGN_TAB_STOP_POSITION, cppu::UnoType::get(),   
0},
 { OUString("PrinterName"),HANDLE_PRINTER_NAME, 
   cppu::UnoType::get(),   

[Libreoffice-commits] core.git: sc/inc sc/source sw/source

2014-02-12 Thread Takeshi Abe
 sc/inc/chart2uno.hxx   |1 -
 sc/inc/chartlis.hxx|1 -
 sc/inc/dapiuno.hxx |1 -
 sc/inc/dptabres.hxx|1 -
 sc/inc/token.hxx   |1 -
 sc/source/core/data/documen3.cxx   |1 -
 sc/source/core/data/documen8.cxx   |1 -
 sc/source/core/data/dpcache.cxx|2 --
 sc/source/core/data/dpfilteredcache.cxx|3 ---
 sc/source/core/opencl/formulagroupcl.cxx   |1 -
 sc/source/filter/excel/xeformula.cxx   |1 -
 sc/source/filter/inc/ftools.hxx|1 -
 sc/source/filter/xml/xmlannoi.hxx  |1 -
 sc/source/ui/inc/dpcontrol.hxx |3 ---
 sc/source/ui/inc/gridwin.hxx   |1 -
 sc/source/ui/inc/pvlaydlg.hxx  |1 -
 sc/source/ui/namedlg/namedlg.cxx   |1 -
 sc/source/ui/unoobj/filtuno.cxx|2 --
 sc/source/ui/vba/vbasheetobject.hxx|1 -
 sc/source/ui/view/spelleng.cxx |2 --
 sw/source/core/inc/UndoTable.hxx   |1 -
 sw/source/ui/vba/vbadocumentproperties.cxx |1 -
 22 files changed, 29 deletions(-)

New commits:
commit 6364a3ec6f92fc1f4ac3c7a4e2bdce2a2140c736
Author: Takeshi Abe t...@fixedpoint.jp
Date:   Thu Feb 13 10:40:30 2014 +0900

Drop unnecessary #include

Change-Id: I9bc9c21811100d6cc1ee7e381a3735567e3bda34

diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 60dd248..c229204 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -50,7 +50,6 @@
 
 #include list
 #include vector
-#include memory
 #include boost/shared_ptr.hpp
 #include boost/unordered_set.hpp
 #include boost/noncopyable.hpp
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 9fa6a1d8..ea80fa7 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -26,7 +26,6 @@
 #include token.hxx
 #include externalrefmgr.hxx
 
-#include memory
 #include vector
 #include list
 
diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index 590f60f..a5c0791 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -55,7 +55,6 @@
 #include cppuhelper/implbase4.hxx
 #include cppuhelper/implbase5.hxx
 
-#include memory
 #include vector
 
 namespace com { namespace sun { namespace star { namespace sheet {
diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index 4610f20..a6a3da6 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -31,7 +31,6 @@
 #include boost/unordered_map.hpp
 #include boost/unordered_set.hpp
 #include vector
-#include memory
 #include map
 
 namespace com { namespace sun { namespace star { namespace sheet {
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 0046c44..ae271a0 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -20,7 +20,6 @@
 #ifndef SC_TOKEN_HXX
 #define SC_TOKEN_HXX
 
-#include memory
 #include vector
 #include boost/intrusive_ptr.hpp
 
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index dd25b7b..e8fed65d 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -73,7 +73,6 @@
 #include scopetools.hxx
 
 #include globalnames.hxx
-#include memory
 #include boost/scoped_ptr.hpp
 
 using namespace com::sun::star;
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 187a86e..1c750ce 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -88,7 +88,6 @@
 #include stringutil.hxx
 #include documentlinkmgr.hxx
 
-#include memory
 #include boost/scoped_ptr.hpp
 
 using namespace com::sun::star;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 21599335..478fc0a 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -35,8 +35,6 @@
 #include unotools/localedatawrapper.hxx
 #include svl/zforlist.hxx
 
-#include memory
-
 #if DEBUG_PIVOT_TABLE
 #include com/sun/star/sheet/DataPilotFieldGroupBy.hpp
 #endif
diff --git a/sc/source/core/data/dpfilteredcache.cxx 
b/sc/source/core/data/dpfilteredcache.cxx
index 62c33eb..a5e9694 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -38,13 +38,10 @@
 #include com/sun/star/sheet/DataPilotFieldFilter.hpp
 #include com/sun/star/sheet/DataPilotFieldGroupBy.hpp
 
-#include memory
-
 using namespace ::com::sun::star;
 
 using ::std::vector;
 using ::std::pair;
-using ::std::auto_ptr;
 using ::com::sun::star::i18n::LocaleDataItem;
 using ::com::sun::star::uno::Exception;
 using ::com::sun::star::uno::Reference;
diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 2a31d7b..923e4e8 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -52,7 +52,6 @@ static const unsigned long __nan[2] = {0x, 
0x7fff};
 #ifdef MD5_KERNEL
 #include rtl/digest.h
 #endif
-#include memory
 
 #include