[Libreoffice-commits] .: 4 commits - sc/inc sc/qa sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Tue Sep 6 14:57:02 PDT 2011


 sc/inc/attarray.hxx                       |    2 
 sc/inc/column.hxx                         |    2 
 sc/inc/document.hxx                       |   10 ++--
 sc/inc/table.hxx                          |    2 
 sc/qa/unit/data/ods/universal-content.ods |binary
 sc/qa/unit/filters-test.cxx               |   63 +++++++++++++++++++++++++++---
 sc/qa/unit/ucalc.cxx                      |    4 -
 sc/source/core/data/attarray.cxx          |   15 -------
 sc/source/core/data/column.cxx            |    4 -
 sc/source/core/data/documen9.cxx          |    2 
 sc/source/core/data/document.cxx          |   12 ++---
 sc/source/core/data/table2.cxx            |    4 -
 sc/source/filter/xml/xmltabi.cxx          |   28 +++++++------
 sc/source/ui/docshell/docfunc.cxx         |   10 ++--
 sc/source/ui/docshell/externalrefmgr.cxx  |   29 ++++++++++++-
 sc/source/ui/undo/undoblk.cxx             |    2 
 sc/source/ui/view/printfun.cxx            |    2 
 sc/source/ui/view/viewdata.cxx            |    2 
 sc/source/ui/view/viewfun3.cxx            |    2 
 19 files changed, 130 insertions(+), 65 deletions(-)

New commits:
commit 4432b06ff40146352a4d21f8b4d612bcc72d7176
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Sep 6 21:53:39 2011 +0200

    initital work for a unit test for calc's basic features
    
    the SC_DLLPUBLIC changes in document.hxx are only necessary until we can
    link statically against sc

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index a73a391..53d796d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -801,7 +801,7 @@ public:
     sal_Bool            HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
 
     /** Returns the pointer to a cell note object at the passed cell address. */
-    ScPostIt*       GetNote( const ScAddress& rPos );
+    SC_DLLPUBLIC ScPostIt*       GetNote( const ScAddress& rPos );
     /** Sets the passed note at the cell with the passed cell address. */
     void            TakeNote( const ScAddress& rPos, ScPostIt*& rpNote );
     /** Returns and forgets the cell note object at the passed cell address. */
@@ -822,7 +822,7 @@ public:
     sal_Bool            ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
                                 SCCOL& rEndCol, SCROW& rEndRow, const ScMarkData& rMark,
                                 sal_Bool bRefresh = false );
-    sal_Bool            ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
+    SC_DLLPUBLIC sal_Bool            ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
                                 SCCOL& rEndCol, SCROW& rEndRow, SCTAB nTab,
                                 sal_Bool bRefresh = false );
     sal_Bool            ExtendMerge( ScRange& rRange, sal_Bool bRefresh = false );
diff --git a/sc/qa/unit/data/ods/universal-content.ods b/sc/qa/unit/data/ods/universal-content.ods
new file mode 100644
index 0000000..f3a23a9
Binary files /dev/null and b/sc/qa/unit/data/ods/universal-content.ods differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 087e26c..b0b01a3 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -56,6 +56,8 @@
 #include <sfx2/sfxmodelfactory.hxx>
 
 #include "docsh.hxx"
+#include "document.hxx"
+#include "postit.hxx"
 
 const int indeterminate = 2;
 
@@ -82,11 +84,14 @@ public:
      */
     void testCVEs();
 
-    void testODSs();
+    //ods filter tests
+    void testRangeName();
+    void testContent();
 
     CPPUNIT_TEST_SUITE(FiltersTest);
     CPPUNIT_TEST(testCVEs);
-    CPPUNIT_TEST(testODSs);
+    CPPUNIT_TEST(testRangeName);
+    CPPUNIT_TEST(testContent);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -190,13 +195,13 @@ void FiltersTest::testCVEs()
 
 }
 
-void FiltersTest::testODSs()
+void FiltersTest::testRangeName()
 {
-    rtl::OUString aString1(RTL_CONSTASCII_USTRINGPARAM("calc8"));
-    rtl::OUString aString2 = m_aSrcRoot + rtl::OUString(
+    rtl::OUString aFilter(RTL_CONSTASCII_USTRINGPARAM("calc8"));
+    rtl::OUString aFileName = m_aSrcRoot + rtl::OUString(
         RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/ods/named-ranges-global.ods"));
 
-    ScDocShellRef xDocSh = load( aString1, aString2 , rtl::OUString(), ODS_FORMAT_TYPE);
+    ScDocShellRef xDocSh = load( aFilter, aFileName , rtl::OUString(), ODS_FORMAT_TYPE);
 
     CPPUNIT_ASSERT_MESSAGE("Failed to load named-ranges-global.ods.", xDocSh.Is());
 
@@ -227,6 +232,52 @@ void FiltersTest::testODSs()
     CPPUNIT_ASSERT_MESSAGE("range name Sheet2.local1 should reference Sheet1.A5", aValue == 5);
 }
 
+void FiltersTest::testContent()
+{
+    //this test checks for some basic functions in calc import
+    rtl::OUString aFilterName(RTL_CONSTASCII_USTRINGPARAM("calc8"));
+    rtl::OUString aFileName = m_aSrcRoot + rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM("/sc/qa/unit/data/ods/universal-content.ods"));
+    ScDocShellRef xDocSh = load ( aFilterName, aFileName, rtl::OUString(), ODS_FORMAT_TYPE);
+
+    CPPUNIT_ASSERT_MESSAGE("Failed to load universal-content.ods", xDocSh.Is());
+
+    ScDocument* pDoc = xDocSh->GetDocument();
+    double aValue;
+    //check value import
+    pDoc->GetValue(0,0,0,aValue);
+    CPPUNIT_ASSERT_MESSAGE("value not imported correctly", aValue == 1);
+    pDoc->GetValue(0,1,0,aValue);
+    CPPUNIT_ASSERT_MESSAGE("value not imported correctly", aValue == 2);
+    rtl::OUString aString;
+    pDoc->GetString(1,0,0,aString);
+    //check string import
+    CPPUNIT_ASSERT_MESSAGE("string imported not correctly", aString == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("String1")));
+    pDoc->GetString(1,1,0,aString);
+    CPPUNIT_ASSERT_MESSAGE("string not imported correctly", aString == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("String2")));
+    //check basic formula import
+    pDoc->GetValue(2,0,0,aValue);
+    CPPUNIT_ASSERT_MESSAGE("=2*3", aValue==6);
+    pDoc->GetValue(2,1,0,aValue);
+    CPPUNIT_ASSERT_MESSAGE("=2+3", aValue==5);
+    pDoc->GetValue(2,2,0,aValue);
+    CPPUNIT_ASSERT_MESSAGE("=2-3", aValue==-1);
+    pDoc->GetValue(2,3,0,aValue);
+    CPPUNIT_ASSERT_MESSAGE("=C1+C2", aValue==11);
+    //check merged cells import
+    SCCOL nCol = 4;
+    SCROW nRow = 1;
+    pDoc->ExtendMerge(4, 1, nCol, nRow, 0, false);
+    std::cout << nCol << " " << nRow << std::endl;
+    CPPUNIT_ASSERT_MESSAGE("merged cells are not imported", nCol == 5 && nRow == 2);
+    //check notes import
+    ScAddress aAddress(7, 2, 0);
+    ScPostIt* pNote = pDoc->GetNote(aAddress);
+    CPPUNIT_ASSERT_MESSAGE("note not imported", pNote);
+    CPPUNIT_ASSERT_MESSAGE("note text not imported correctly", pNote->GetText() == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test")));
+    //add additional checks here
+}
+
 FiltersTest::FiltersTest()
     : m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://"))
 {
commit 67b374980f340faa2695001984aaf98886a32fad
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Sep 4 14:25:33 2011 +0200

    related #i114504: external reference manager part

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 72aa2cf..a66dd35 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -62,6 +62,7 @@
 #include "sfx2/linkmgr.hxx"
 #include "tools/urlobj.hxx"
 #include "unotools/ucbhelper.hxx"
+#include "unotools/localfilehelper.hxx"
 
 #include <memory>
 #include <algorithm>
@@ -2201,6 +2202,10 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
         return NULL;
 
     OUString aOptions = pFileData->maFilterOptions;
+    if ( pFileData->maFilterName.getLength() )
+        rFilter = pFileData->maFilterName;      // don't overwrite stored filter with guessed filter
+    else
+        ScDocumentLoader::GetFilterName(aFile, rFilter, aOptions, true, false);;
     ScDocumentLoader::GetFilterName(aFile, rFilter, aOptions, true, false);
     const SfxFilter* pFilter = ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName(rFilter);
 
@@ -2267,10 +2272,19 @@ bool ScExternalRefManager::isFileLoadable(const OUString& rFile) const
 
     if (isOwnDocument(rFile))
         return false;
+    String aPhysical;
+    if (utl::LocalFileHelper::ConvertURLToPhysicalName(rFile, aPhysical) && aPhysical.Len())
+    {
+        // #i114504# try IsFolder/Exists only for file URLs
 
-    if (utl::UCBContentHelper::IsFolder(rFile))
-        return false;
+    return utl::UCBContentHelper::Exists(rFile);
+        if (utl::UCBContentHelper::IsFolder(rFile))
+            return false;
 
+        return utl::UCBContentHelper::Exists(rFile);
+    }
+    else
+        return true;    // for http and others, Exists doesn't work, but the URL can still be opened
     return utl::UCBContentHelper::Exists(rFile);
 }
 
@@ -2286,7 +2300,16 @@ void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId)
         return;
 
     OUString aFilter, aOptions;
-    ScDocumentLoader::GetFilterName(*pFileName, aFilter, aOptions, true, false);
+    const SrcFileData* pFileData = getExternalFileData(nFileId);
+    if (pFileData)
+    {
+        aFilter = pFileData->maFilterName;
+        aOptions = pFileData->maFilterOptions;
+    }
+    // If a filter was already set (for example, loading the cached table),
+    // don't call GetFilterName which has to access the source file.
+    if (!aFilter.getLength())
+        ScDocumentLoader::GetFilterName(*pFileName, aFilter, aOptions, true, false);
     sfx2::LinkManager* pLinkMgr = mpDoc->GetLinkManager();
     ScExternalRefLink* pLink = new ScExternalRefLink(mpDoc, nFileId, aFilter);
     OSL_ENSURE(pFileName, "ScExternalRefManager::insertExternalFileLink: file name pointer is NULL");
commit 1f36d1208e13cb950183121adb2d020c41d1f58e
Author: Niklas Nebel <nn at openoffice.org>
Date:   Sun Sep 4 12:52:46 2011 +0200

    related #i114504: don't assume external references are always file urls

diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx
index bc9a3ce..e8f8b81 100644
--- a/sc/source/filter/xml/xmltabi.cxx
+++ b/sc/source/filter/xml/xmltabi.cxx
@@ -57,6 +57,8 @@
 #include <xmloff/xmltoken.hxx>
 #include <xmloff/XMLEventsImportContext.hxx>
 
+#include <tools/urlobj.hxx>
+
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/sheet/XSpreadsheets.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
@@ -90,27 +92,29 @@ static bool lcl_isExternalRefCache(const rtl::OUString& rName, rtl::OUString& rU
     // 'file:///path/to/file's.ods'#Sheet (Notice the quote in the file name.
     //  That's allowed.)
 
-    static const sal_Unicode aPrefix[] = {
-        '\'', 'f', 'i', 'l', 'e', ':', '/', '/'
-    };
+    if ( rName.toChar() != '\'' )       // initial quote
+        return false;
+
+    // #i114504# Other schemes besides "file:" are also allowed.
+    // CompareProtocolScheme is quick, only looks at the start of the string.
+    INetProtocol eProt = INetURLObject::CompareProtocolScheme( rName.copy(1) );
+    if ( eProt == INET_PROT_NOT_VALID )
+        return false;
+
+    rtl::OUString aPrefix = INetURLObject::GetScheme( eProt );
+    sal_Int32 nPrefLen = aPrefix.getLength();
 
     rtl::OUStringBuffer aUrlBuf, aTabNameBuf;
-    aUrlBuf.appendAscii("file://");
+    aUrlBuf.append( aPrefix );
     sal_Int32 n = rName.getLength();
     const sal_Unicode* p = rName.getStr();
 
     bool bInUrl = true;
     sal_Unicode cPrev = 0;
-    for (sal_Int32 i = 0; i < n; ++i)
+    for (sal_Int32 i = nPrefLen+1; i < n; ++i)      // start the loop after quote and prefix
     {
         const sal_Unicode c = p[i];
-        if (i <= 7)
-        {
-            // Checking the prefix 'file://'.
-            if (c != aPrefix[i])
-                return false;
-        }
-        else if (bInUrl)
+        if (bInUrl)
         {
             // parsing file URL
             if (c == '#')
commit 5b47818367290640421f835bdd038bc35c6b0781
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Sep 5 22:01:41 2011 +0200

    merge area does not need to be increased if a shadow is attached

diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 291e182..b3fe1a5 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -161,7 +161,7 @@ public:
     bool    HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const;
     sal_Bool    ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
                                 SCCOL& rPaintCol, SCROW& rPaintRow,
-                                sal_Bool bRefresh, sal_Bool bAttrs );
+                                sal_Bool bRefresh );
     sal_Bool    RemoveAreaMerge( SCROW nStartRow, SCROW nEndRow );
 
     void    FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 6ce3bed..7e21ba8 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -156,7 +156,7 @@ public:
     bool    HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
     bool    ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
                                 SCCOL& rPaintCol, SCROW& rPaintRow,
-                                bool bRefresh, bool bAttrs );
+                                bool bRefresh );
 
     bool               IsEmptyVisData(bool bNotes) const;              // without Broadcaster
     bool               IsEmptyData() const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 97ed45e..a73a391 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -821,11 +821,11 @@ public:
 
     sal_Bool            ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
                                 SCCOL& rEndCol, SCROW& rEndRow, const ScMarkData& rMark,
-                                sal_Bool bRefresh = false, sal_Bool bAttrs = false );
+                                sal_Bool bRefresh = false );
     sal_Bool            ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
                                 SCCOL& rEndCol, SCROW& rEndRow, SCTAB nTab,
-                                sal_Bool bRefresh = false, sal_Bool bAttrs = false );
-    sal_Bool            ExtendMerge( ScRange& rRange, sal_Bool bRefresh = false, sal_Bool bAttrs = false );
+                                sal_Bool bRefresh = false );
+    sal_Bool            ExtendMerge( ScRange& rRange, sal_Bool bRefresh = false );
     sal_Bool            ExtendTotalMerge( ScRange& rRange );
     SC_DLLPUBLIC sal_Bool           ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
                                 SCCOL nEndCol, SCROW nEndRow, SCTAB nTab );
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index f85852d..efe483d 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -512,7 +512,7 @@ public:
     bool        HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
     bool        ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
                                 SCCOL& rEndCol, SCROW& rEndRow,
-                                bool bRefresh, bool bAttrs );
+                                bool bRefresh );
     const SfxPoolItem*      GetAttr( SCCOL nCol, SCROW nRow, sal_uInt16 nWhich ) const;
     const ScPatternAttr*    GetPattern( SCCOL nCol, SCROW nRow ) const;
     const ScPatternAttr*    GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const;
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 543c912..e32c28b 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2284,14 +2284,14 @@ void Test::testMergedCells()
     m_pDoc->DoMerge(0, 1, 1, 3, 3, false);
     SCCOL nEndCol = 1;
     SCROW nEndRow = 1;
-    m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false, false);
+    m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false);
     CPPUNIT_ASSERT_MESSAGE("did not merge cells", nEndCol == 3 && nEndRow == 3);
     ScDocFunc aDocFunc(*m_xDocShRef);
     ScRange aRange(0,2,0,MAXCOL,2,0);
     ScMarkData aMark;
     aMark.SetMarkArea(aRange);
     aDocFunc.InsertCells(aRange, &aMark, INS_INSROWS, true, true);
-    m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false, false);
+    m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false);
     cout << nEndRow << nEndCol;
     //have a look why this does not work
     //CPPUNIT_ASSERT_MESSAGE("did not increase merge area", nEndCol == 3 && nEndRow == 4);
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 4296beb..d2a75b1 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1352,7 +1352,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const
 // Area around any given summaries expand and adapt any MergeFlag (bRefresh)
 sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
                                 SCCOL& rPaintCol, SCROW& rPaintRow,
-                                sal_Bool bRefresh, sal_Bool bAttrs )
+                                sal_Bool bRefresh )
 {
     const ScPatternAttr* pPattern;
     const ScMergeAttr* pItem;
@@ -1379,19 +1379,6 @@ sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRo
                 rPaintRow = nMergeEndRow;
             bFound = sal_True;
 
-            if (bAttrs)
-            {
-                const SvxShadowItem* pShadow =
-                        (const SvxShadowItem*) &pPattern->GetItem( ATTR_SHADOW );
-                SvxShadowLocation eLoc = pShadow->GetLocation();
-                if ( eLoc == SVX_SHADOW_TOPRIGHT || eLoc == SVX_SHADOW_BOTTOMRIGHT )
-                    if ( nMergeEndCol+1 > rPaintCol && nMergeEndCol < MAXCOL )
-                        rPaintCol = nMergeEndCol+1;
-                if ( eLoc == SVX_SHADOW_BOTTOMLEFT || eLoc == SVX_SHADOW_BOTTOMRIGHT )
-                    if ( nMergeEndRow+1 > rPaintRow && nMergeEndRow < MAXROW )
-                        rPaintRow = nMergeEndRow+1;
-            }
-
             if (bRefresh)
             {
                 if ( nMergeEndCol > nThisCol )
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 6808617..055dec5 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -280,9 +280,9 @@ bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) c
 
 bool ScColumn::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow,
                             SCCOL& rPaintCol, SCROW& rPaintRow,
-                            bool bRefresh, bool bAttrs )
+                            bool bRefresh )
 {
-    return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh, bAttrs );
+    return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh );
 }
 
 
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index 86bc767..f756160 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -513,7 +513,7 @@ sal_Bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
         SCROW nTmpRow = nEndRow;
 
         pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab,
-                            false, sal_True );      // kein Refresh, incl. Attrs
+                            false );      // kein Refresh, incl. Attrs
 
         OutputDevice* pDev = pThis->GetPrinter();
         pDev->SetMapMode( MAP_PIXEL );              // wichtig fuer GetNeededSize
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index dcb9502..5522ac1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4977,7 +4977,7 @@ sal_Bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow,
 
 sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
                               SCCOL& rEndCol, SCROW& rEndRow,
-                              const ScMarkData& rMark, sal_Bool bRefresh, sal_Bool bAttrs )
+                              const ScMarkData& rMark, sal_Bool bRefresh )
 {
     // use all selected sheets from rMark
 
@@ -4992,7 +4992,7 @@ sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
         {
             SCCOL nThisEndCol = nOldEndCol;
             SCROW nThisEndRow = nOldEndRow;
-            if ( ExtendMerge( nStartCol, nStartRow, nThisEndCol, nThisEndRow, *itr, bRefresh, bAttrs ) )
+            if ( ExtendMerge( nStartCol, nStartRow, nThisEndCol, nThisEndRow, *itr, bRefresh ) )
                 bFound = true;
             if ( nThisEndCol > rEndCol )
                 rEndCol = nThisEndCol;
@@ -5006,13 +5006,13 @@ sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow,
 
 sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
                               SCCOL& rEndCol,  SCROW& rEndRow,
-                              SCTAB nTab, sal_Bool bRefresh, sal_Bool bAttrs )
+                              SCTAB nTab, sal_Bool bRefresh )
 {
     bool bFound = false;
     if ( ValidColRow(nStartCol,nStartRow) && ValidColRow(rEndCol,rEndRow) && ValidTab(nTab) )
     {
         if (nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
-            bFound = maTabs[nTab]->ExtendMerge( nStartCol, nStartRow, rEndCol, rEndRow, bRefresh, bAttrs );
+            bFound = maTabs[nTab]->ExtendMerge( nStartCol, nStartRow, rEndCol, rEndRow, bRefresh );
 
         if (bRefresh)
             RefreshAutoFilter( nStartCol, nStartRow, rEndCol, rEndRow, nTab );
@@ -5026,7 +5026,7 @@ sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
 }
 
 
-sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh, sal_Bool bAttrs )
+sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh )
 {
     bool bFound = false;
     SCTAB nStartTab = rRange.aStart.Tab();
@@ -5041,7 +5041,7 @@ sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh, sal_Bool b
         SCROW nExtendRow = rRange.aEnd.Row();
         if (ExtendMerge( rRange.aStart.Col(), rRange.aStart.Row(),
                          nExtendCol,          nExtendRow,
-                         nTab, bRefresh, bAttrs ) )
+                         nTab, bRefresh ) )
         {
             bFound = true;
             if (nExtendCol > nEndCol) nEndCol = nExtendCol;
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 812b07f..6b18359 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1397,7 +1397,7 @@ bool ScTable::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) co
 
 bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
                            SCCOL& rEndCol, SCROW& rEndRow,
-                           bool bRefresh, bool bAttrs )
+                           bool bRefresh )
 {
     if (!(ValidCol(nStartCol) && ValidCol(rEndCol)))
     {
@@ -1408,7 +1408,7 @@ bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow,
     SCCOL nOldEndX = rEndCol;
     SCROW nOldEndY = rEndRow;
     for (SCCOL i=nStartCol; i<=nOldEndX; i++)
-        bFound |= aCol[i].ExtendMerge( i, nStartRow, nOldEndY, rEndCol, rEndRow, bRefresh, bAttrs );
+        bFound |= aCol[i].ExtendMerge( i, nStartRow, nOldEndY, rEndCol, rEndRow, bRefresh );
     return bFound;
 }
 
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 7d2774b..7410da8 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1537,7 +1537,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
                 {
                     ScRange aRange( nTestCol, nTestRow1, i );
                     pDoc->ExtendOverlapped(aRange);
-                    pDoc->ExtendMerge(aRange, sal_True, sal_True);
+                    pDoc->ExtendMerge(aRange, sal_True);
 
                     if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR )
                     {
@@ -1545,7 +1545,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa
                         {
                             ScRange aTestRange( nTestCol, nTestRow, i );
                             pDoc->ExtendOverlapped( aTestRange );
-                            pDoc->ExtendMerge( aTestRange, sal_True, sal_True);
+                            pDoc->ExtendMerge( aTestRange, sal_True);
                             ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
                             if( !aExtendRange.In( aMergeRange ) )
                             {
@@ -1940,7 +1940,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
                 {
                     ScRange aRange( nTestCol, nTestRow1, i );
                     pDoc->ExtendOverlapped( aRange );
-                    pDoc->ExtendMerge( aRange, sal_True, sal_True );
+                    pDoc->ExtendMerge( aRange, sal_True );
 
                     if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR )
                     {
@@ -1948,7 +1948,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa
                         {
                             ScRange aTestRange( nTestCol, nTestRow, i );
                             pDoc->ExtendOverlapped( aTestRange );
-                            pDoc->ExtendMerge( aTestRange, sal_True, sal_True);
+                            pDoc->ExtendMerge( aTestRange, sal_True );
                             ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i );
                             if( !aExtendRange.In( aMergeRange ) )
                             {
@@ -4446,7 +4446,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, sal_Bool bRecord
                               aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
                               SC_MF_HOR | SC_MF_VER );
 
-        pDoc->ExtendMerge( aRefresh, sal_True, false );
+        pDoc->ExtendMerge( aRefresh, sal_True );
 
         if ( !AdjustRowHeight( aExtended ) )
             rDocShell.PostPaint( aExtended, PAINT_GRID );
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 6625dc0..79496b0 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -2136,7 +2136,7 @@ void ScUndoRemoveMerge::Redo()
                               maOption.mnEndCol, maOption.mnEndRow, nTab,
                               SC_MF_HOR | SC_MF_VER );
 
-        pDoc->ExtendMerge(aRange, true, false);
+        pDoc->ExtendMerge(aRange, true);
 
         //  Paint
 
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index a1ee4df..43d6a5d 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -757,7 +757,7 @@ sal_Bool ScPrintFunc::AdjustPrintArea( sal_Bool bNew )
     }
 
     pDoc->ExtendMerge( nStartCol,nStartRow, nEndCol,nEndRow, nPrintTab,
-                        false, sal_True );      // kein Refresh, incl. Attrs
+                        false );      // kein Refresh, incl. Attrs
 
     if ( bChangeCol )
     {
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 37830ee..10b9e41 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1831,7 +1831,7 @@ sal_Bool ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWh
                 pDoc->RemoveFlagsTab( 0,0, MAXCOL,MAXROW, nTabNo, SC_MF_HOR | SC_MF_VER );
                 SCCOL nEndCol = MAXCOL;
                 SCROW nEndRow = MAXROW;
-                pDoc->ExtendMerge( 0,0, nEndCol,nEndRow, nTabNo, sal_True, false );
+                pDoc->ExtendMerge( 0,0, nEndCol,nEndRow, nTabNo, sal_True );
                 if (pDocShell)
                     pDocShell->PostPaint( ScRange(0,0,nTabNo,MAXCOL,MAXROW,nTabNo), PAINT_GRID );
             }
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index a3c1ab3..bc418f7 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1270,7 +1270,7 @@ sal_Bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc,
                 {
                     ScRange aRange(nCol, nRow1, nStartTab);
                     pDoc->ExtendOverlapped(aRange);
-                    pDoc->ExtendMerge(aRange, sal_True, sal_True);
+                    pDoc->ExtendMerge(aRange, sal_True);
                     rDocFunc.UnmergeCells(aRange, bRecord, sal_True);
                 }
             }


More information about the Libreoffice-commits mailing list