[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Tor Lillqvist tml at kemper.freedesktop.org
Sun Mar 18 23:58:26 PDT 2012


 sc/source/ui/app/transobj.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 39228c6d2419636be04ee4a320a7c0ca08276f37
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.
    
    (cherry picked from commit 0ee518863337fba9bce019e05e24f527617a4321)
    
    Signed-off-by: Tor Lillqvist <tlillqvist at suse.com>

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index a61e5d3..ae73542 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -313,7 +313,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 )
             {


More information about the Libreoffice-commits mailing list