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

Takeshi Abe tabe at fixedpoint.jp
Fri Apr 7 01:09:16 UTC 2017


 starmath/inc/node.hxx            |   12 ------------
 starmath/source/mathmlimport.cxx |   12 ++++++++++++
 starmath/source/mathmlimport.hxx |    3 +++
 3 files changed, 15 insertions(+), 12 deletions(-)

New commits:
commit a9bd83bdd390724372d2da3451fae083a72af5b0
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Thu Apr 6 18:53:04 2017 +0900

    starmath: Move SmNodeStack to mathmlimport.hxx
    
    which is the only place using it.
    
    Change-Id: I87d5a1f0d0993f7585c9767fc32eb46158503dfb
    Reviewed-on: https://gerrit.libreoffice.org/36197
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 79c4e0ff33a4..7c9fbcec892b 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -31,7 +31,6 @@
 #include <cassert>
 #include <memory>
 #include <vector>
-#include <deque>
 
 enum class FontAttribute {
     None   = 0x0000,
@@ -76,19 +75,8 @@ class SmDocShell;
 class SmNode;
 class SmStructureNode;
 
-typedef std::deque<std::unique_ptr<SmNode>> SmNodeStack;
 typedef std::vector< SmNode * > SmNodeArray;
 
-template < typename T >
-T* popOrZero(std::deque<std::unique_ptr<T>> & rStack)
-{
-    if (rStack.empty())
-        return nullptr;
-    std::unique_ptr<T> pTmp(std::move(rStack.front()));
-    rStack.pop_front();
-    return pTmp.release();
-}
-
 enum SmScaleMode    { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT };
 
 enum SmNodeType
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index abcea1149093..13cf4d62a01e 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -84,6 +84,18 @@ using namespace ::xmloff::token;
 
 #define IMPORT_SVC_NAME "com.sun.star.xml.XMLImportFilter"
 
+namespace {
+
+SmNode* popOrZero(SmNodeStack& rStack)
+{
+    if (rStack.empty())
+        return nullptr;
+    auto pTmp = std::move(rStack.front());
+    rStack.pop_front();
+    return pTmp.release();
+}
+
+}
 
 sal_uLong SmXMLImportWrapper::Import(SfxMedium &rMedium)
 {
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index addab491ca3f..ded4ced23b72 100644
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -26,6 +26,7 @@
 #include <xmloff/xmltoken.hxx>
 
 #include <node.hxx>
+#include <deque>
 #include <memory>
 
 class SfxMedium;
@@ -37,6 +38,8 @@ namespace com { namespace sun { namespace star {
 } } }
 
 
+typedef std::deque<std::unique_ptr<SmNode>> SmNodeStack;
+
 class SmXMLImportWrapper
 {
     css::uno::Reference<css::frame::XModel> xModel;


More information about the Libreoffice-commits mailing list