diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-05-28 09:32:03 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-05-30 01:44:47 +0000 |
commit | e71ab23aa3c1a645b383beafe848d06ed08d8838 (patch) | |
tree | 5d2984830befd20a7f2c35321fe73527fcc33d6d /starmath | |
parent | 7a2bca302f8299d70f77952110fb4ccfa4b258c2 (diff) |
starmath: Drop redundant IsFormulaArranged() check
as ArrangeFormula() itself checks bIsFormulaArranged,
and does nothing if it's on.
Change-Id: Icc76208f6881d4de99e88feae5f19d7e8890e4e9
Reviewed-on: https://gerrit.libreoffice.org/25570
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/document.hxx | 1 | ||||
-rw-r--r-- | starmath/source/document.cxx | 21 | ||||
-rw-r--r-- | starmath/source/unomodel.cxx | 3 |
3 files changed, 10 insertions, 15 deletions
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index e52fa192c133..499bd564bb91 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -156,7 +156,6 @@ public: static void SaveSymbols(); void ArrangeFormula(); - bool IsFormulaArranged() const { return bIsFormulaArranged; } //Access for the View. This access is not for the OLE-case! //and for the communication with the SFX! diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 8028a02bf803..4646d03ea6a4 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -215,8 +215,7 @@ void SmDocShell::SetFormat(SmFormat& rFormat) OUString SmDocShell::GetAccessibleText() { - if (!IsFormulaArranged()) - ArrangeFormula(); + ArrangeFormula(); if (aAccText.isEmpty()) { OSL_ENSURE( pTree, "Tree missing" ); @@ -244,7 +243,7 @@ void SmDocShell::Parse() void SmDocShell::ArrangeFormula() { - if (IsFormulaArranged()) + if (bIsFormulaArranged) return; // Only for the duration of the existence of this object the correct settings @@ -402,8 +401,7 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel Parse(); OSL_ENSURE(pTree, "Sm : NULL pointer"); - if (!IsFormulaArranged()) - ArrangeFormula(); + ArrangeFormula(); // Problem: What happens to WYSIWYG? While we're active inplace, we don't have a reference // device and aren't aligned to that either. So now there can be a difference between the @@ -460,8 +458,7 @@ Size SmDocShell::GetSize() if (pTree) { - if (!IsFormulaArranged()) - ArrangeFormula(); + ArrangeFormula(); aRet = pTree->GetSize(); if ( !aRet.Width() ) @@ -783,7 +780,7 @@ bool SmDocShell::Save() { if (!pTree) Parse(); - if( pTree && !IsFormulaArranged() ) + if( pTree ) ArrangeFormula(); Reference<css::frame::XModel> xModel(GetModel()); @@ -843,7 +840,7 @@ bool SmDocShell::SaveAs( SfxMedium& rMedium ) { if (!pTree) Parse(); - if( pTree && !IsFormulaArranged() ) + if( pTree ) ArrangeFormula(); Reference<css::frame::XModel> xModel(GetModel()); @@ -862,7 +859,7 @@ bool SmDocShell::ConvertTo( SfxMedium &rMedium ) { if( !pTree ) Parse(); - if( pTree && !IsFormulaArranged() ) + if( pTree ) ArrangeFormula(); const OUString& rFltName = pFlt->GetFilterName(); @@ -893,7 +890,7 @@ bool SmDocShell::writeFormulaOoxml( { if( !pTree ) Parse(); - if( pTree && !IsFormulaArranged() ) + if( pTree ) ArrangeFormula(); SmOoxmlExport aEquation(pTree, version, documentType); return aEquation.ConvertFromStarMath( pSerializer ); @@ -903,7 +900,7 @@ void SmDocShell::writeFormulaRtf(OStringBuffer& rBuffer, rtl_TextEncoding nEncod { if (!pTree) Parse(); - if (pTree && !IsFormulaArranged()) + if (pTree) ArrangeFormula(); SmRtfExport aEquation(pTree); aEquation.ConvertFromStarMath(rBuffer, nEncoding); diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 8a57d01e4e0c..1207228d9bfc 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -896,8 +896,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu pDocSh->Parse(); if ( pDocSh->GetFormulaTree() ) { - if ( !pDocSh->IsFormulaArranged() ) - pDocSh->ArrangeFormula(); + pDocSh->ArrangeFormula(); *pValue <<= static_cast<sal_Int32>( pDocSh->GetFormulaTree()->GetFormulaBaseline() ); } |