[Libreoffice-commits] core.git: 4 commits - desktop/source ios/experimental sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Apr 12 16:40:06 UTC 2016


 desktop/source/app/sofficemain.cxx                               |   28 ----------
 ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m |    4 -
 ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m   |    5 -
 sc/source/filter/excel/excform8.cxx                              |   23 ++++----
 sc/source/filter/excel/xeformula.cxx                             |    4 +
 5 files changed, 16 insertions(+), 48 deletions(-)

New commits:
commit bff788ff811400d816cec6582e9abdf73be90fb7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 12 18:35:58 2016 +0200

    xls does not allow 3D refs in cond format formulas, tdf#62770
    
    Change-Id: I4f2bf913d09452ccfed9976ccd56a82daf1c3ec8

diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 9742cb6..af0e6c3 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1808,6 +1808,10 @@ bool XclExpFmlaCompImpl::IsRef2D( const ScSingleRefData& rRefData, bool bCheck3D
         the own sheet. If 3D references are allowed, the passed reference does
         not count as 2D reference. */
 
+    // conditional formatting does not allow 3D refs in xls
+    if (this->mxData->mrCfg.meType == EXC_FMLATYPE_CONDFMT)
+        return true;
+
     if (bCheck3DFlag && rRefData.IsFlag3D())
         return false;
 
commit ce66533a066dcc9c899da8b15c788642ac4ae979
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 12 17:21:49 2016 +0200

    conditional format formulas don't support 3d refs in xls, tdf#62770
    
    Change-Id: I5238a3be7bc11a33eb3b60f3950ebfb0f565e805

diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index 96c1b94..5e43915 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -605,7 +605,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
                 nCol = aIn.ReaduInt16();
 
                 aSRD.SetRelTab(0);
-                aSRD.SetFlag3D( bRangeNameOrCond );
+                aSRD.SetFlag3D( bRangeName );
 
                 ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
 
@@ -621,8 +621,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
 
                 aCRD.Ref1.SetRelTab(0);
                 aCRD.Ref2.SetRelTab(0);
-                aCRD.Ref1.SetFlag3D( bRangeNameOrCond );
-                aCRD.Ref2.SetFlag3D( bRangeNameOrCond );
+                aCRD.Ref1.SetFlag3D( bRangeName );
+                aCRD.Ref2.SetFlag3D( bRangeName );
 
                 nRowFirst = aIn.ReaduInt16();
                 nRowLast = aIn.ReaduInt16();
commit 3dee5e2c1d6b2c56a98bf28939afdcbc21b94b14
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 12 17:14:28 2016 +0200

    better variable names for range name case in xls formula import
    
    Change-Id: Ib9de454b7445bfd4c3bb12202d53119c129a2369

diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index f0668cb..96c1b94 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -141,9 +141,10 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
     bool                    bArrayFormula = false;
     TokenId                 nMerk0;
     const bool              bCondFormat = eFT == FT_CondFormat;
-    const bool              bRangeName = eFT == FT_RangeName || bCondFormat;
+    const bool              bRangeName = eFT == FT_RangeName;
+    const bool              bRangeNameOrCond = bRangeName || bCondFormat;
     const bool              bSharedFormula = eFT == FT_SharedFormula;
-    const bool              bRNorSF = bRangeName || bSharedFormula;
+    const bool              bRNorSF = bRangeNameOrCond || bSharedFormula;
 
     ScSingleRefData         aSRD;
     ScComplexRefData            aCRD;
@@ -510,9 +511,9 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
                 nCol = aIn.ReaduInt16();
 
                 aSRD.SetRelTab(0);
-                aSRD.SetFlag3D( bRangeName && !bCondFormat );
+                aSRD.SetFlag3D( bRangeName );
 
-                ExcRelToScRel8( nRow, nCol, aSRD, bRangeName );
+                ExcRelToScRel8( nRow, nCol, aSRD, bRangeNameOrCond );
 
                 switch ( nOp )
                 {
@@ -546,11 +547,11 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
 
                 rSRef1.SetRelTab(0);
                 rSRef2.SetRelTab(0);
-                rSRef1.SetFlag3D( bRangeName && !bCondFormat );
-                rSRef2.SetFlag3D( bRangeName && !bCondFormat );
+                rSRef1.SetFlag3D( bRangeName );
+                rSRef2.SetFlag3D( bRangeName );
 
-                ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRangeName );
-                ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRangeName );
+                ExcRelToScRel8( nRowFirst, nColFirst, aCRD.Ref1, bRangeNameOrCond );
+                ExcRelToScRel8( nRowLast, nColLast, aCRD.Ref2, bRangeNameOrCond );
 
                 if( IsComplColRange( nColFirst, nColLast ) )
                     SetComplCol( aCRD );
@@ -604,7 +605,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
                 nCol = aIn.ReaduInt16();
 
                 aSRD.SetRelTab(0);
-                aSRD.SetFlag3D( bRangeName );
+                aSRD.SetFlag3D( bRangeNameOrCond );
 
                 ExcRelToScRel8( nRow, nCol, aSRD, bRNorSF );
 
@@ -620,8 +621,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
 
                 aCRD.Ref1.SetRelTab(0);
                 aCRD.Ref2.SetRelTab(0);
-                aCRD.Ref1.SetFlag3D( bRangeName );
-                aCRD.Ref2.SetFlag3D( bRangeName );
+                aCRD.Ref1.SetFlag3D( bRangeNameOrCond );
+                aCRD.Ref2.SetFlag3D( bRangeNameOrCond );
 
                 nRowFirst = aIn.ReaduInt16();
                 nRowLast = aIn.ReaduInt16();
@@ -799,7 +800,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
                 aSRD.SetAbsTab(nTabFirst);
                 aSRD.SetFlag3D(true);
 
-                ExcRelToScRel8( nRw, nGrbitCol, aSRD, bRangeName );
+                ExcRelToScRel8( nRw, nGrbitCol, aSRD, bRangeNameOrCond );
 
                 switch ( nOp )
                 {
@@ -875,8 +876,8 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn,
                 rR1.SetFlag3D(true);
                 rR2.SetFlag3D( nTabFirst != nTabLast );
 
-                ExcRelToScRel8( nRw1, nGrbitCol1, aCRD.Ref1, bRangeName );
-                ExcRelToScRel8( nRw2, nGrbitCol2, aCRD.Ref2, bRangeName );
+                ExcRelToScRel8( nRw1, nGrbitCol1, aCRD.Ref1, bRangeNameOrCond );
+                ExcRelToScRel8( nRw2, nGrbitCol2, aCRD.Ref2, bRangeNameOrCond );
 
                 if( IsComplColRange( nGrbitCol1, nGrbitCol2 ) )
                     SetComplCol( aCRD );
commit 988e2a750e9b12bdad519b834083ee7f6794a0b6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 12 15:10:39 2016 +0200

    remove that unused old code
    
    Change-Id: I576f6be6d229e29d0ae35ffb00d118bfd44b5544

diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx
index 8d402fd..e86d901 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -142,32 +142,4 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main()
 #endif
 }
 
-#if defined(ANDROID) || defined(IOS)
-
-extern "C" void PtylTestEncryptionAndExport(const char *pathname)
-{
-    OUString sUri(pathname, strlen(pathname), RTL_TEXTENCODING_UTF8);
-    sUri = "file://" + sUri;
-
-    css::uno::Reference<css::frame::XComponentLoader> loader(css::frame::Desktop::create(cppu::defaultBootstrap_InitialComponentContext()), css::uno::UNO_QUERY);
-    css::uno::Reference<css::lang::XComponent> component;
-    component.set(loader->loadComponentFromURL(sUri, "_default", 0, {}));
-
-    utl::MediaDescriptor media;
-    media[utl::MediaDescriptor::PROP_FILTERNAME()] <<= OUString("MS Word 2007 XML");
-    OUString password("myPassword");
-    css::uno::Sequence<css::beans::NamedValue> encryptionData { { "OOXPassword", css::uno::makeAny(password) } };
-    media[utl::MediaDescriptor::PROP_ENCRYPTIONDATA()] <<= encryptionData;
-
-    css::uno::Reference<css::frame::XModel> model(component, css::uno::UNO_QUERY);
-    css::uno::Reference<css::frame::XStorable2> storable2(model, css::uno::UNO_QUERY);
-    OUString saveAsUri(sUri + ".new.docx");
-    SAL_INFO("desktop.app", "Trying to store as " << saveAsUri);
-    OUString testPathName;
-    osl::File::getSystemPathFromFileURL(saveAsUri+".txt", testPathName);
-    storable2->storeToURL(saveAsUri, media.getAsConstPropertyValueList());
-}
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
index bcf4e22..addcccf 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/AppDelegate.m
@@ -65,15 +65,11 @@ static LibreOfficeKitDocument* document;
     return YES;
 }
 
-const char *ptyl_test_encryption_pathname;
-
 - (void)startDisplaying:(NSString*)documentPath;
 {
     ViewController *vc = [[ViewController alloc] init];
     self.window.rootViewController = vc;
 
-    ptyl_test_encryption_pathname = [documentPath UTF8String];
-
     // kit = lok_init([[[NSBundle mainBundle] bundlePath] UTF8String]);
     kit = lok_init(NULL);
     document = kit->pClass->documentLoad(kit, [documentPath UTF8String]);
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m b/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m
index de0d975..98e3025 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m
@@ -136,9 +136,6 @@ static bool tileMatches(const char *spec, CGRect bb)
             y == (int) (bb.origin.y / bb.size.height));
 }
 
-extern void PtylTestEncryptionAndExport(const char *pathname);
-extern const char *ptyl_test_encryption_pathname;
-
 - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
 {
     // Even if I set the CATL's tileSize to 512x512 above, this is
@@ -148,8 +145,6 @@ extern const char *ptyl_test_encryption_pathname;
     static bool once = false;
     if (!once) {
         once = true;
-        if (getenv("PTYL_TEST_ENCRYPTION_AND_EXPORT"))
-            PtylTestEncryptionAndExport(ptyl_test_encryption_pathname);
     }
 
     CGRect bb = CGContextGetClipBoundingBox(ctx);


More information about the Libreoffice-commits mailing list