[Libreoffice-commits] core.git: framework/inc framework/source io/source oox/inc oox/source vcl/source writerfilter/source

Noel Grandin noel at peralex.com
Mon Aug 3 05:16:34 PDT 2015


 framework/inc/classes/framecontainer.hxx          |    2 --
 framework/source/classes/framecontainer.cxx       |    8 ++++----
 io/source/TextInputStream/TextInputStream.cxx     |    4 +---
 io/source/TextOutputStream/TextOutputStream.cxx   |    4 +---
 oox/inc/drawingml/textparagraph.hxx               |    2 --
 oox/source/drawingml/textbody.cxx                 |    2 +-
 vcl/source/edit/textdat2.hxx                      |    4 +---
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |   21 ++++++---------------
 8 files changed, 14 insertions(+), 33 deletions(-)

New commits:
commit 5256953397b495e9271cec92cc78514d772acaf5
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Aug 3 11:35:58 2015 +0200

    inline some use-once typedefs
    
    Change-Id: I55cc82c8e180cce371c996690608090b1bfdfda4
    Reviewed-on: https://gerrit.libreoffice.org/17494
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/framework/inc/classes/framecontainer.hxx b/framework/inc/classes/framecontainer.hxx
index 4c43a82..fb7cf04 100644
--- a/framework/inc/classes/framecontainer.hxx
+++ b/framework/inc/classes/framecontainer.hxx
@@ -41,8 +41,6 @@
 namespace framework{
 
 typedef ::std::vector< css::uno::Reference< css::frame::XFrame > >  TFrameContainer;
-typedef TFrameContainer::iterator                                   TFrameIterator;
-typedef TFrameContainer::const_iterator                             TConstFrameIterator;
 
 /*-************************************************************************************************************
     @short          implement a container to hold children of frame, task or desktop
diff --git a/framework/source/classes/framecontainer.cxx b/framework/source/classes/framecontainer.cxx
index 002d453..bd83d57 100644
--- a/framework/source/classes/framecontainer.cxx
+++ b/framework/source/classes/framecontainer.cxx
@@ -86,7 +86,7 @@ void FrameContainer::remove( const css::uno::Reference< css::frame::XFrame >& xF
 {
     SolarMutexGuard g;
 
-    TFrameIterator aSearchedItem = ::std::find( m_aContainer.begin(), m_aContainer.end(), xFrame );
+    TFrameContainer::iterator aSearchedItem = ::std::find( m_aContainer.begin(), m_aContainer.end(), xFrame );
     if (aSearchedItem!=m_aContainer.end())
     {
         m_aContainer.erase( aSearchedItem );
@@ -188,7 +188,7 @@ css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > FrameContainer::
     SolarMutexGuard g;
     sal_Int32                                                       nPosition = 0;
     css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > lElements ( (sal_uInt32)m_aContainer.size() );
-    for (TConstFrameIterator pItem=m_aContainer.begin(); pItem!=m_aContainer.end(); ++pItem)
+    for (TFrameContainer::const_iterator pItem=m_aContainer.begin(); pItem!=m_aContainer.end(); ++pItem)
         lElements[nPosition++] = *pItem;
     return lElements;
 }
@@ -245,7 +245,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::searchOnAllChildrens(
     // Step over all child frames. But if direct child isn't the right one search on his children first - before
     // you go to next direct child of this container!
     css::uno::Reference< css::frame::XFrame > xSearchedFrame;
-    for( TConstFrameIterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator )
+    for( TFrameContainer::const_iterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator )
     {
         if ((*pIterator)->getName()==sName)
         {
@@ -277,7 +277,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::searchOnDirectChildren
 {
     SolarMutexGuard g;
     css::uno::Reference< css::frame::XFrame > xSearchedFrame;
-    for( TConstFrameIterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator )
+    for( TFrameContainer::const_iterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator )
     {
         if ((*pIterator)->getName()==sName)
         {
diff --git a/io/source/TextInputStream/TextInputStream.cxx b/io/source/TextInputStream/TextInputStream.cxx
index 115ba04..dfe601b 100644
--- a/io/source/TextInputStream/TextInputStream.cxx
+++ b/io/source/TextInputStream/TextInputStream.cxx
@@ -50,12 +50,10 @@ namespace io_TextInputStream
 
 // Implementation XTextInputStream
 
-typedef WeakImplHelper2< XTextInputStream2, XServiceInfo > TextInputStreamHelper;
-
 #define INITIAL_UNICODE_BUFFER_CAPACITY     0x100
 #define READ_BYTE_COUNT                     0x100
 
-class OTextInputStream : public TextInputStreamHelper
+class OTextInputStream : public WeakImplHelper2< XTextInputStream2, XServiceInfo >
 {
     Reference< XInputStream > mxStream;
 
diff --git a/io/source/TextOutputStream/TextOutputStream.cxx b/io/source/TextOutputStream/TextOutputStream.cxx
index 4a5c7b2..846b595 100644
--- a/io/source/TextOutputStream/TextOutputStream.cxx
+++ b/io/source/TextOutputStream/TextOutputStream.cxx
@@ -50,9 +50,7 @@ namespace io_TextOutputStream
 
 // Implementation XTextOutputStream
 
-typedef WeakImplHelper2< XTextOutputStream2, XServiceInfo > TextOutputStreamHelper;
-
-class OTextOutputStream : public TextOutputStreamHelper
+class OTextOutputStream : public WeakImplHelper2< XTextOutputStream2, XServiceInfo >
 {
     Reference< XOutputStream > mxStream;
 
diff --git a/oox/inc/drawingml/textparagraph.hxx b/oox/inc/drawingml/textparagraph.hxx
index d3e93d4..6a0643f 100644
--- a/oox/inc/drawingml/textparagraph.hxx
+++ b/oox/inc/drawingml/textparagraph.hxx
@@ -63,8 +63,6 @@ private:
     TextRunVector               maRuns;
 };
 
-typedef std::shared_ptr< TextParagraph > TextParagraphPtr;
-
 } }
 
 #endif // INCLUDED_OOX_DRAWINGML_TEXTPARAGRAPH_HXX
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index 165b9db..3aa835e 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -47,7 +47,7 @@ TextBody::~TextBody()
 
 TextParagraph& TextBody::addParagraph()
 {
-    TextParagraphPtr xPara( new TextParagraph );
+    std::shared_ptr< TextParagraph > xPara( new TextParagraph );
     maParagraphs.push_back( xPara );
     return *xPara;
 }
diff --git a/vcl/source/edit/textdat2.hxx b/vcl/source/edit/textdat2.hxx
index c1cdded..d18166e 100644
--- a/vcl/source/edit/textdat2.hxx
+++ b/vcl/source/edit/textdat2.hxx
@@ -78,9 +78,7 @@ public:
     bool        HasValidSize() const        { return nWidth != (-1); }
 };
 
-typedef std::vector<TETextPortion*> TextPortionArray;
-
-class TETextPortionList : public TextPortionArray
+class TETextPortionList : public std::vector<TETextPortion*>
 {
 public:
     TETextPortionList();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 4b2e638..519f8e5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -226,13 +226,6 @@ struct AnchoredContext
 
 typedef std::shared_ptr<FieldContext>  FieldContextPtr;
 
-typedef std::stack<ContextType>                 ContextStack;
-typedef std::stack<PropertyMapPtr>              PropertyStack;
-typedef std::stack< TextAppendContext >         TextAppendStack;
-typedef std::stack<HeaderFooterContext> HeaderFooterStack;
-typedef std::stack<FieldContextPtr>                FieldStack;
-typedef std::stack< AnchoredContext >           TextContentStack;
-
 /*-------------------------------------------------------------------------
     extended tab stop struct
   -----------------------------------------------------------------------*/
@@ -340,12 +333,10 @@ private:
     css::uno::Reference<css::text::XText> m_xBodyText;
     css::uno::Reference<css::text::XTextContent> m_xEmbedded;
 
-    TextAppendStack                                                                 m_aTextAppendStack;
-
-    TextContentStack                                                                m_aAnchoredStack;
-
-    HeaderFooterStack m_aHeaderFooterStack;
-    FieldStack                                                                      m_aFieldStack;
+    std::stack<TextAppendContext>                                                   m_aTextAppendStack;
+    std::stack<AnchoredContext>                                                     m_aAnchoredStack;
+    std::stack<HeaderFooterContext>                                                 m_aHeaderFooterStack;
+    std::stack<FieldContextPtr>                                                     m_aFieldStack;
     bool                                                                            m_bSetUserFieldContent;
     bool                                                                            m_bSetCitation;
     bool                                                                            m_bSetDateValue;
@@ -379,8 +370,8 @@ private:
     std::shared_ptr<DomainMapperTableHandler> m_pTableHandler;
 
     //each context needs a stack of currently used attributes
-    PropertyStack           m_aPropertyStacks[NUMBER_OF_CONTEXTS];
-    ContextStack            m_aContextStack;
+    std::stack<PropertyMapPtr>  m_aPropertyStacks[NUMBER_OF_CONTEXTS];
+    std::stack<ContextType> m_aContextStack;
     FontTablePtr            m_pFontTable;
     ListsManager::Pointer   m_pListTable;
     std::deque< css::uno::Reference<css::drawing::XShape> > m_aPendingShapes;


More information about the Libreoffice-commits mailing list