[Libreoffice-commits] .: Branch 'feature/tubes' - sc/source

Eike Rathke erack at kemper.freedesktop.org
Tue Jul 17 02:37:10 PDT 2012


 sc/source/ui/collab/sendfunc.cxx  |    9 +++++++--
 sc/source/ui/collab/sendfunc.hxx  |    2 +-
 sc/source/ui/docshell/docfunc.cxx |   14 ++++++++++----
 sc/source/ui/inc/docfunc.hxx      |    2 +-
 sc/source/ui/view/viewfunc.cxx    |   11 +++++++++--
 5 files changed, 28 insertions(+), 10 deletions(-)

New commits:
commit a79219ded027de8d90edf281061a58a955c0d4f5
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jul 17 11:28:22 2012 +0200

    tubes: reintroduced handling of extending formats in ScViewFunc::EnterData()
    
    In ScDocFunc*::SetNormalString() pass the underlying
    ScDocument::SetString() return value back to caller.
    
    Change-Id: Ie75169af1bd9bc55d1447ee14e1206407d750c73

diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index 27d8c93..c16364b 100644
--- a/sc/source/ui/collab/sendfunc.cxx
+++ b/sc/source/ui/collab/sendfunc.cxx
@@ -77,8 +77,11 @@ void ScDocFuncRecv::RecvMessage( const rtl::OString &rString )
                                                  RTL_TEXTENCODING_UTF8 ) );
         // FIXME: have some hash to enumeration mapping here
         if ( aReader.getMethod() == "setNormalString" )
-            mpChain->SetNormalString( aReader.getAddress( 1 ), aReader.getString( 2 ),
+        {
+            bool bNumFmtSet = false;
+            mpChain->SetNormalString( bNumFmtSet, aReader.getAddress( 1 ), aReader.getString( 2 ),
                                       aReader.getBool( 3 ) );
+        }
         else if ( aReader.getMethod() == "putCell" )
         {
             ScBaseCell *pNewCell = aReader.getCell( 2 );
@@ -313,7 +316,7 @@ void ScDocFuncSend::EndListAction()
     SendMessage( aOp );
 }
 
-sal_Bool ScDocFuncSend::SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi )
+sal_Bool ScDocFuncSend::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const String& rText, sal_Bool bApi )
 {
     ScChangeOpWriter aOp( "setNormalString" );
     aOp.appendAddress( rPos );
@@ -321,6 +324,8 @@ sal_Bool ScDocFuncSend::SetNormalString( const ScAddress& rPos, const String& rT
     aOp.appendBool( bApi );
     SendMessage( aOp );
 
+    o_rbNumFmtSet = false;
+
     if ( rtl::OUString( rText ) == "saveme" )
         SendFile( rText );
 
diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx
index 459be2a..9813633 100644
--- a/sc/source/ui/collab/sendfunc.hxx
+++ b/sc/source/ui/collab/sendfunc.hxx
@@ -244,7 +244,7 @@ public:
     virtual void        EnterListAction( sal_uInt16 nNameResId );
     virtual void        EndListAction();
 
-    virtual sal_Bool    SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi );
+    virtual sal_Bool    SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const String& rText, sal_Bool bApi );
     virtual sal_Bool    PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi );
     virtual sal_Bool    PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
                                 sal_Bool bInterpret, sal_Bool bApi );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 72227ed..f8df434 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -761,7 +761,7 @@ sal_Bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
 
 //------------------------------------------------------------------------
 
-sal_Bool ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi )
+sal_Bool ScDocFunc::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const String& rText, sal_Bool bApi )
 {
     ScDocShellModificator aModificator( rDocShell );
     ScDocument* pDoc = rDocShell.GetDocument();
@@ -802,7 +802,7 @@ sal_Bool ScDocFunc::SetNormalString( const ScAddress& rPos, const String& rText,
             pHasFormat[0] = false;
     }
 
-    pDoc->SetString( rPos.Col(), rPos.Row(), rPos.Tab(), rText );
+    o_rbNumFmtSet = pDoc->SetString( rPos.Col(), rPos.Row(), rPos.Tab(), rText );
 
     if (bUndo)
     {
@@ -988,7 +988,10 @@ sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngi
     {
         String aText = rEngine.GetText();
         if ( bInterpret || !aText.Len() )
-            bRet = SetNormalString( rPos, aText, bApi );
+        {
+            bool bNumFmtSet = false;
+            bRet = SetNormalString( bNumFmtSet, rPos, aText, bApi );
+        }
         else
             bRet = PutCell( rPos, new ScStringCell( aText ), bApi );
     }
@@ -1107,7 +1110,10 @@ sal_Bool ScDocFunc::SetCellText( const ScAddress& rPos, const String& rText,
     if (pNewCell)
         return PutCell( rPos, pNewCell, bApi );
     else
-        return SetNormalString( rPos, rText, bApi );
+    {
+        bool bNumFmtSet = false;
+        return SetNormalString( bNumFmtSet, rPos, rText, bApi );
+    }
 }
 
 //------------------------------------------------------------------------
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index 61524c7..fcf851c 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -95,7 +95,7 @@ public:
     virtual sal_Bool        TransliterateText( const ScMarkData& rMark, sal_Int32 nType,
                                                sal_Bool bRecord, sal_Bool bApi );
 
-    virtual sal_Bool        SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi );
+    virtual sal_Bool        SetNormalString( bool& o_rbNumFmtSet, const ScAddress& rPos, const String& rText, sal_Bool bApi );
     virtual sal_Bool        PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi );
     virtual sal_Bool        PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
                                       sal_Bool bInterpret, sal_Bool bApi );
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 18659f0..64f4a58 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -539,9 +539,16 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
         {
             ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
             for ( ; itr != itrEnd; ++itr )
-                if ( rFunc.SetNormalString( ScAddress( nCol, nRow, *itr ),
-                                            rString, sal_False ) )
+            {
+                bool bNumFmtSet = false;
+                rFunc.SetNormalString( bNumFmtSet, ScAddress( nCol, nRow, *itr ), rString, sal_False );
+                if (bNumFmtSet)
+                {
+                    /* FIXME: if set on any sheet results in changed only on
+                     * sheet nTab for TestFormatArea() and DoAutoAttributes() */
                     bNumFmtChanged = true;
+                }
+            }
         }
 
         sal_Bool bAutoFormat = TestFormatArea(nCol, nRow, nTab, bNumFmtChanged);


More information about the Libreoffice-commits mailing list