[Libreoffice-commits] .: sc/inc sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Jan 8 06:51:44 PST 2013
sc/inc/cell.hxx | 3 +--
sc/source/core/data/cell2.cxx | 10 +++++-----
sc/source/core/data/column2.cxx | 3 +--
sc/source/core/data/table6.cxx | 3 +--
sc/source/filter/html/htmlexp.cxx | 5 ++---
sc/source/filter/rtf/rtfexp.cxx | 3 +--
sc/source/filter/xml/xmlcelli.cxx | 2 +-
sc/source/ui/app/transobj.cxx | 3 +--
sc/source/ui/docshell/docsh.cxx | 3 +--
sc/source/ui/view/gridwin.cxx | 3 +--
sc/source/ui/view/output2.cxx | 8 ++------
sc/source/ui/view/spelleng.cxx | 3 +--
sc/source/ui/view/tabvwsha.cxx | 2 +-
sc/source/ui/view/viewfun4.cxx | 6 +++---
14 files changed, 22 insertions(+), 35 deletions(-)
New commits:
commit ab3be69580024da53653e06b34f515bef6ef690e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Jan 8 09:51:47 2013 -0500
Let's not have two variants of this getter. One is enough.
And let's stick with the one that returns the data pointer.
Change-Id: I931be0d73adcf6f3888d05ef58bc0f905f5a6958
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 30ee12b..ee040a2 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -242,10 +242,9 @@ public:
void SetData( const EditTextObject* pObject,
const SfxItemPool* pFromPool /* = NULL */ );
- void GetData( const EditTextObject*& rpObject ) const;
rtl::OUString GetString() const;
- const EditTextObject* GetData() const { return pData; }
+ const EditTextObject* GetData() const;
/** Removes character attribute based on new pattern attributes. */
void RemoveCharAttribs( const ScPatternAttr& rAttr );
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index bcf5283..c43f0c1 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -104,11 +104,6 @@ void ScEditCell::SetData( const EditTextObject* pObject,
SetTextObject( pObject, pFromPool );
}
-void ScEditCell::GetData( const EditTextObject*& rpObject ) const
-{
- rpObject = pData;
-}
-
rtl::OUString ScEditCell::GetString() const
{
if ( pString )
@@ -129,6 +124,11 @@ rtl::OUString ScEditCell::GetString() const
return rtl::OUString();
}
+const EditTextObject* ScEditCell::GetData() const
+{
+ return pData;
+}
+
void ScEditCell::RemoveCharAttribs( const ScPatternAttr& rAttr )
{
const struct {
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 42f6cd0..5f30ebd 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -389,8 +389,7 @@ long ScColumn::GetNeededSize(
if ( pCell->GetCellType() == CELLTYPE_EDIT )
{
- const EditTextObject* pData;
- ((ScEditCell*)pCell)->GetData(pData);
+ const EditTextObject* pData = static_cast<ScEditCell*>(pCell)->GetData();
pEngine->SetTextNewDefaults(*pData, pSet);
}
else
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index f49ba9f..b3b183f 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -43,8 +43,7 @@ bool lcl_GetTextWithBreaks( const ScEditCell& rCell, ScDocument* pDoc, rtl::OUSt
{
// true = more than 1 paragraph
- const EditTextObject* pData = NULL;
- rCell.GetData( pData );
+ const EditTextObject* pData = rCell.GetData();
EditEngine& rEngine = pDoc->GetEditEngine();
rEngine.SetText( *pData );
rVal = rEngine.GetText( LINEEND_LF );
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 5045dd7..de2888e 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1206,9 +1206,8 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
{
- sal_Bool bFields = false;
- const EditTextObject* pData;
- pCell->GetData( pData );
+ bool bFields = false;
+ const EditTextObject* pData = pCell->GetData();
// text and anchor of URL fields, Doc-Engine is a ScFieldEditEngine
EditEngine& rEngine = pDoc->GetEditEngine();
rEngine.SetText( *pData );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 2af2395..14c9b21 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -188,8 +188,7 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
{
bValueData = false;
EditEngine& rEngine = GetEditEngine();
- const EditTextObject* pObj;
- ((const ScEditCell*)pCell)->GetData( pObj );
+ const EditTextObject* pObj = static_cast<const ScEditCell*>(pCell)->GetData();
if ( pObj )
{
rEngine.SetText( *pObj );
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index b67496c..e937570 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -954,7 +954,7 @@ rtl::OUString getOutputString(ScDocument* pDoc, const ScAddress& aCellPos)
{
// GetString an der EditCell macht Leerzeichen aus Umbruechen,
// hier werden die Umbrueche aber gebraucht
- const EditTextObject* pData = ( static_cast< ScEditCell* >(pCell) )->GetData();
+ const EditTextObject* pData = static_cast<ScEditCell*>(pCell)->GetData();
if (pData)
{
EditEngine& rEngine = pDoc->GetEditEngine();
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 3560ac1..e8a96c5 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -271,8 +271,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
{
if (pCell->GetCellType() == CELLTYPE_EDIT)
{
- const EditTextObject* pObj;
- ((ScEditCell*)pCell)->GetData(pObj);
+ const EditTextObject* pObj = static_cast<const ScEditCell*>(pCell)->GetData();
aEngine.SetText( *pObj );
}
else
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f910070..c8ff10b 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1874,8 +1874,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt
break;
case CELLTYPE_EDIT :
{
- const EditTextObject* pObj;
- static_cast<const ScEditCell*>(pCell)->GetData( pObj);
+ const EditTextObject* pObj = static_cast<const ScEditCell*>(pCell)->GetData();
EditEngine& rEngine = aDocument.GetEditEngine();
rEngine.SetText( *pObj);
aString = rEngine.GetText(); // including LF
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 96edbcb..2a8d705 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5099,8 +5099,7 @@ bool ScGridWindow::GetEditUrlOrError( bool bSpellErr, const Point& rPos,
::std::auto_ptr< EditTextObject > pTextObj;
if(pCell->GetCellType() == CELLTYPE_EDIT)
{
- const EditTextObject* pData;
- ((ScEditCell*)pCell)->GetData(pData);
+ const EditTextObject* pData = static_cast<ScEditCell*>(pCell)->GetData();
if (pData)
aEngine.SetText(*pData);
}
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 5461fec..58f7f6d 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2258,9 +2258,7 @@ bool ScOutputData::DrawEditParam::readCellContent(
if (mpCell->GetCellType() == CELLTYPE_EDIT)
{
- const EditTextObject* pData;
- ((ScEditCell*)mpCell)->GetData(pData);
-
+ const EditTextObject* pData = static_cast<ScEditCell*>(mpCell)->GetData();
if (pData)
{
mpEngine->SetText(*pData);
@@ -4981,9 +4979,7 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
{
if (pCell->GetCellType() == CELLTYPE_EDIT)
{
- const EditTextObject* pData;
- ((ScEditCell*)pCell)->GetData(pData);
-
+ const EditTextObject* pData = static_cast<ScEditCell*>(pCell)->GetData();
if (pData)
pEngine->SetText(*pData);
else
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index bdebf71..783b570 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -292,8 +292,7 @@ void ScConversionEngineBase::FillFromCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
mrDoc.GetCell( nCol, nRow, nTab, pCell );
if( pCell )
{
- const EditTextObject* pNewEditObj = NULL;
- static_cast< ScEditCell* >( pCell )->GetData( pNewEditObj );
+ const EditTextObject* pNewEditObj = static_cast<ScEditCell*>(pCell)->GetData();
if( pNewEditObj )
SetText( *pNewEditObj );
}
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 45e9f02..9dab0b3 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -640,7 +640,7 @@ void ScTabViewShell::UpdateInputHandler( sal_Bool bForce /* = sal_False */, sal_
{
ScBaseCell* pCell;
pDoc->GetCell( nPosX, nPosY, nTab, pCell );
- ((ScEditCell*)pCell)->GetData( pObject );
+ pObject = static_cast<ScEditCell*>(pCell)->GetData();
}
else
{
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 8c9bd9c..2de541a 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -374,7 +374,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
pDoc->GetCell(nCol, nRow, nTab, pCell);
if (pCell)
{
- ((ScEditCell*) pCell)->GetData(pTObject);
+ pTObject = static_cast<ScEditCell*>(pCell)->GetData();
if (pTObject)
{
pOldTObj = pTObject->Clone();
@@ -732,7 +732,7 @@ void ScViewFunc::InsertBookmark( const String& rDescription, const String& rURL,
{
if (pCell->GetCellType() == CELLTYPE_EDIT)
{
- const EditTextObject* pOld = ((ScEditCell*)pCell)->GetData();
+ const EditTextObject* pOld = static_cast<ScEditCell*>(pCell)->GetData();
if (pOld)
aEngine.SetText(*pOld);
}
@@ -777,7 +777,7 @@ sal_Bool ScViewFunc::HasBookmarkAtCursor( SvxHyperlinkItem* pContent )
ScBaseCell* pCell = pDoc->GetCell( aPos );
if ( pCell && pCell->GetCellType() == CELLTYPE_EDIT )
{
- const EditTextObject* pData = ((ScEditCell*)pCell)->GetData();
+ const EditTextObject* pData = static_cast<ScEditCell*>(pCell)->GetData();
if (pData)
{
sal_Bool bField = pData->IsFieldObject();
More information about the Libreoffice-commits
mailing list