[Libreoffice-commits] core.git: starmath/inc starmath/source

Takeshi Abe tabe at fixedpoint.jp
Mon May 30 01:45:15 UTC 2016


 starmath/inc/document.hxx    |    1 -
 starmath/source/document.cxx |   21 +++++++++------------
 starmath/source/unomodel.cxx |    3 +--
 3 files changed, 10 insertions(+), 15 deletions(-)

New commits:
commit e71ab23aa3c1a645b383beafe848d06ed08d8838
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Sat May 28 09:32:03 2016 +0900

    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 at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index e52fa19..499bd56 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 8028a02..4646d03 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 8a57d01..1207228 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() );
                 }


More information about the Libreoffice-commits mailing list