summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-07-17 11:28:22 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:31 +0200
commit98cd5f3fa3f90b38073f10b4c9e62f4ace8a0477 (patch)
tree5eb432991212828bc0631687f69028d7500ff322
parenttubes: improve contacts dialog (diff)
downloadcore-98cd5f3fa3f90b38073f10b4c9e62f4ace8a0477.tar.gz
core-98cd5f3fa3f90b38073f10b4c9e62f4ace8a0477.zip
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
-rw-r--r--sc/source/ui/collab/sendfunc.cxx9
-rw-r--r--sc/source/ui/collab/sendfunc.hxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx14
-rw-r--r--sc/source/ui/inc/docfunc.hxx2
-rw-r--r--sc/source/ui/view/viewfunc.cxx11
5 files changed, 28 insertions, 10 deletions
diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx
index 27d8c9363aa7..c16364bf5385 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 459be2afaa82..981363358065 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 f22c599eef91..29dda061dda0 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -754,7 +754,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();
@@ -795,7 +795,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)
{
@@ -981,7 +981,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 );
}
@@ -1100,7 +1103,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 61524c711f85..fcf851c0e661 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 19153ecc9cff..1ac9b21446af 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);