[Libreoffice-commits] .: 3 commits - sc/qa sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Sun Mar 18 10:39:03 PDT 2012


 sc/qa/unoapi/sc.sce               |    4 ++--
 sc/source/filter/xml/xmldrani.cxx |   10 +++++++---
 sc/source/filter/xml/xmldrani.hxx |    2 ++
 sc/source/ui/app/transobj.cxx     |   15 ++++++++++++++-
 4 files changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 0ee518863337fba9bce019e05e24f527617a4321
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 18 18:34:51 2012 +0100

    also shrink used area for HTML in some cases, fdo#46230, n#677811
    
    Hopefully this will allow pasting to external applications with whole
    column/row selected while not affecting calc itself.

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index b52ca6f..cb1fa54 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -310,7 +310,20 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
 
             sal_Bool bIncludeFiltered = pDoc->IsCutMode() || bUsedForLink;
 
-            ScImportExport aObj( pDoc, aBlock );
+            ScRange aReducedBlock = aBlock;
+            if ( nFormat == SOT_FORMATSTR_ID_HTML && (aBlock.aEnd.Col() == MAXCOL || aBlock.aEnd.Row() == MAXROW) && aBlock.aStart.Tab() == aBlock.aEnd.Tab() )
+            {
+                bool bShrunk = false;
+                //shrink the area to allow pasting to external applications
+                SCCOL aStartCol = aReducedBlock.aStart.Col();
+                SCROW aStartRow = aReducedBlock.aStart.Row();
+                SCCOL aEndCol = aReducedBlock.aEnd.Col();
+                SCROW aEndRow = aReducedBlock.aEnd.Row();
+                pDoc->ShrinkToUsedDataArea( bShrunk, aReducedBlock.aStart.Tab(), aStartCol, aStartRow, aEndCol, aEndRow, false);
+                aReducedBlock = ScRange(aStartCol, aStartRow, aReducedBlock.aStart.Tab(), aEndCol, aEndRow, aReducedBlock.aEnd.Tab());
+            }
+
+            ScImportExport aObj( pDoc, aReducedBlock );
             ScExportTextOptions aTextOptions(ScExportTextOptions::None, 0, true);
             if ( bUsedForLink )
             {
commit 90d84c6dcb48886f697b7b29f9673f782994ae95
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 18 18:01:50 2012 +0100

    disable two slow java based subsequenttests, fdo#45337
    
    These two tests are not well designed and need 5 and 10 minute just to
    check that we really return every row. This is not a good trade-off
    between test coverage and execution time.
    
    Enable them again with a better concept.

diff --git a/sc/qa/unoapi/sc.sce b/sc/qa/unoapi/sc.sce
index 28b2cf7..4d6b1d4 100644
--- a/sc/qa/unoapi/sc.sce
+++ b/sc/qa/unoapi/sc.sce
@@ -13,7 +13,7 @@
 -o sc.ScAccessiblePreviewCell
 -o sc.ScAccessiblePreviewHeaderCell
 -o sc.ScAccessiblePreviewTable
--o sc.ScAccessibleSpreadsheet
+# fdo#45337 -o sc.ScAccessibleSpreadsheet
 -o sc.ScAnnotationObj
 -o sc.ScAnnotationShapeObj
 -o sc.ScAnnotationsObj
@@ -80,7 +80,7 @@
 -o sc.ScIndexEnumeration_TableChartsEnumeration
 -o sc.ScIndexEnumeration_TableColumnsEnumeration
 -o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
--o sc.ScIndexEnumeration_TableRowsEnumeration
+# fdo#45337 -o sc.ScIndexEnumeration_TableRowsEnumeration
 -o sc.ScIndexEnumeration_TextFieldEnumeration
 -o sc.ScLabelRangeObj
 -o sc.ScLabelRangesObj
commit ed88b144ce24b9a733d4a9ab6614307c96537baa
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 18 17:44:00 2012 +0100

    add all imported properties to ScDBData, fdo#40426

diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx
index 3ac0fe2..37c4471 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -148,6 +148,8 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport,
     bSubTotalsEnabledUserList(false),
     bSubTotalsAscending(true),
     bFilterConditionSourceRange(false),
+    bHasHeader(true),
+    bByRow(false),
     meRangeType(ScDBCollection::GlobalNamed)
 {
     nSourceType = sheet::DataImportMode_NONE;
@@ -190,12 +192,14 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( ScXMLImport& rImport,
             break;
             case XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION :
             {
-                mpQueryParam->bByRow = !IsXMLToken(sValue, XML_COLUMN);
+                bByRow = !IsXMLToken(sValue, XML_COLUMN);
+                mpQueryParam->bByRow = bByRow;
             }
             break;
             case XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER :
             {
-                mpQueryParam->bHasHeader = IsXMLToken(sValue, XML_TRUE);
+                bHasHeader = IsXMLToken(sValue, XML_TRUE);
+                mpQueryParam->bHasHeader = bHasHeader;
             }
             break;
             case XML_TOK_DATABASE_RANGE_ATTR_DISPLAY_FILTER_BUTTONS :
@@ -303,7 +307,7 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const OUString& rName)
 
     SAL_WNODEPRECATED_DECLARATIONS_PUSH
     ::std::auto_ptr<ScDBData> pData(
-        new ScDBData(rName, maRange.aStart.Tab(), maRange.aStart.Col(), maRange.aStart.Row(), maRange.aEnd.Col(), maRange.aEnd.Row()));
+        new ScDBData(rName, maRange.aStart.Tab(), maRange.aStart.Col(), maRange.aStart.Row(), maRange.aEnd.Col(), maRange.aEnd.Row(), bByRow, bHasHeader));
     SAL_WNODEPRECATED_DECLARATIONS_POP
 
     pData->SetAutoFilter(bAutoFilter);
diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx
index 9fe1408..ff659f8 100644
--- a/sc/source/filter/xml/xmldrani.hxx
+++ b/sc/source/filter/xml/xmldrani.hxx
@@ -106,6 +106,8 @@ class ScXMLDatabaseRangeContext : public SvXMLImportContext
     bool            bSubTotalsEnabledUserList;
     bool            bSubTotalsAscending;
     bool            bFilterConditionSourceRange;
+    bool            bHasHeader;
+    bool            bByRow;
     ScDBCollection::RangeType meRangeType;
 
     const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }


More information about the Libreoffice-commits mailing list