[Libreoffice-commits] core.git: writerfilter/inc

Miklos Vajna vmiklos at collabora.co.uk
Fri Mar 21 01:27:51 PDT 2014


 writerfilter/inc/resourcemodel/OutputWithDepth.hxx  |  127 --------------------
 writerfilter/inc/resourcemodel/SubSequence.hxx      |   98 ---------------
 writerfilter/inc/resourcemodel/WW8ResourceModel.hxx |    1 
 3 files changed, 226 deletions(-)

New commits:
commit 71baf7278beffc6af99a4bd15c86550cbe61a077
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Mar 21 09:12:25 2014 +0100

    writerfilter: remove unused OutputWithDepth
    
    This was only used by doctok.
    
    Change-Id: Ic8f853a02af4915e3d5984a626daa7147c47d16f

diff --git a/writerfilter/inc/resourcemodel/OutputWithDepth.hxx b/writerfilter/inc/resourcemodel/OutputWithDepth.hxx
deleted file mode 100644
index 6899de4..0000000
--- a/writerfilter/inc/resourcemodel/OutputWithDepth.hxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_OUTPUT_WITH_DEPTH
-#define INCLUDED_OUTPUT_WITH_DEPTH
-
-#include <vector>
-#include <iostream>
-
-namespace writerfilter
-{
-
-using namespace ::std;
-
-template <typename T>
-class OutputWithDepth
-{
-    typedef ::std::vector<T> Group_t;
-    Group_t mGroup;
-
-    unsigned int mnCurrentDepth;
-    unsigned int mnGroupDepth;
-
-    T mOpenTag;
-    T mCloseTag;
-
-protected:
-    virtual void output(const T & aItem) const = 0;
-    void outputGroup();
-    void finalize();
-
-public:
-    OutputWithDepth(const T & aOpenTag, const T & aCloseTag);
-    virtual ~OutputWithDepth();
-
-    void openGroup();
-    void closeGroup();
-    void addItem(const T & aItem);
-    void setDepth(unsigned int nDepth);
-};
-
-template <typename T>
-OutputWithDepth<T>::OutputWithDepth(const T & aOpenTag, const T & aEndTag)
-    : mnCurrentDepth(0)
-    , mnGroupDepth(0)
-    , mOpenTag(aOpenTag)
-    , mCloseTag(aEndTag)
-{
-}
-
-template <typename T>
-OutputWithDepth<T>::~OutputWithDepth()
-{
-}
-
-template <typename T>
-void OutputWithDepth<T>::finalize()
-{
-    outputGroup();
-}
-
-template <typename T>
-void OutputWithDepth<T>::openGroup()
-{
-    outputGroup();
-    mnGroupDepth = 0;
-}
-
-template <typename T>
-void OutputWithDepth<T>::closeGroup()
-{
-    if (mnGroupDepth > mnCurrentDepth)
-        for (unsigned int i = 0; i < mnGroupDepth - mnCurrentDepth; ++i)
-            output(mOpenTag);
-    else if (mnGroupDepth < mnCurrentDepth)
-        for (unsigned int i = 0; i < mnCurrentDepth - mnGroupDepth; ++i)
-            output(mCloseTag);
-
-    outputGroup();
-
-    mnCurrentDepth = mnGroupDepth;
-}
-
-template <typename T>
-void OutputWithDepth<T>::addItem(const T & aItem)
-{
-    mGroup.push_back(aItem);
-}
-
-template <typename T>
-void OutputWithDepth<T>::setDepth(unsigned int nDepth)
-{
-    mnGroupDepth = nDepth;
-}
-
-template <typename T>
-void OutputWithDepth<T>::outputGroup()
-{
-    typename Group_t::iterator aItEnd = mGroup.end();
-
-    for (typename Group_t::iterator aIt = mGroup.begin(); aIt != aItEnd; aIt++)
-    {
-        output(*aIt);
-    }
-
-    mGroup.clear();
-}
-}
-#endif // INCLUDED_OUTPUT_WITH_DEPTH
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/inc/resourcemodel/SubSequence.hxx b/writerfilter/inc/resourcemodel/SubSequence.hxx
index f4e08c7..6b6b1ed 100644
--- a/writerfilter/inc/resourcemodel/SubSequence.hxx
+++ b/writerfilter/inc/resourcemodel/SubSequence.hxx
@@ -28,7 +28,6 @@
 #include <ctype.h>
 #include "exceptions.hxx"
 #include <WriterFilterDllApi.hxx>
-#include <resourcemodel/OutputWithDepth.hxx>
 
 namespace writerfilter {
 using namespace ::std;
@@ -36,10 +35,6 @@ using namespace ::std;
 template <class T>
 class SubSequence;
 
-template <typename T>
-void dumpLine(OutputWithDepth<string> & o, SubSequence<T> & rSeq,
-              sal_uInt32 nOffset, sal_uInt32 nStep);
-
 template <class T>
 class SubSequence
 {
@@ -185,44 +180,6 @@ public:
         o << "</sequence>" << endl;
     }
 
-    void dump(OutputWithDepth<string> & o)
-    {
-        {
-            char sBuffer[256];
-
-            snprintf(sBuffer, sizeof(sBuffer),
-                     "<sequence id='%p' offset='%" SAL_PRIxUINT32 "' count='%" SAL_PRIxUINT32 "'>",
-                     mpSequence.get(), mnOffset, mnCount);
-            o.addItem(sBuffer);
-        }
-
-        sal_uInt32 n = 0;
-        sal_uInt32 nStep = 16;
-
-        try
-        {
-            sal_uInt32 nCount = getCount();
-            while (n < nCount)
-            {
-                sal_uInt32 nBytes = nCount - n;
-
-                if (nBytes > nStep)
-                    nBytes = nStep;
-
-                SubSequence<T> aSeq(*this, n, nBytes);
-                dumpLine(o, aSeq, n, nStep);
-
-                n += nBytes;
-            }
-        }
-        catch (...)
-        {
-            o.addItem("<exception/>");
-        }
-
-        o.addItem("</sequence>");
-    }
-
     string toString() const
     {
         sal_uInt32 n = 0;
@@ -283,61 +240,6 @@ public:
     }
 };
 
-template <typename T>
-void dumpLine(OutputWithDepth<string> & o, SubSequence<T> & rSeq,
-              sal_uInt32 nOffset, sal_uInt32 nStep)
-{
-    sal_uInt32 nCount = rSeq.getCount();
-    char sBuffer[256];
-
-    string tmpStr = "<line>";
-
-    snprintf(sBuffer, 255, "%08" SAL_PRIxUINT32 ": ", nOffset);
-
-    tmpStr += sBuffer;
-
-    for (sal_uInt32 i = 0; i < nStep; i++)
-    {
-        if (i < nCount)
-        {
-            snprintf(sBuffer, 255, "%02x ", rSeq[i]);
-            tmpStr += sBuffer;
-        }
-        else
-            tmpStr += "   ";
-
-        if (i % 8 == 7)
-            tmpStr += " ";
-    }
-
-    {
-        for (sal_uInt32 i = 0; i < nStep; i++)
-        {
-            if (i < nCount)
-            {
-                unsigned char c =
-                    static_cast<unsigned char>(rSeq[i]);
-
-                if (c=='&')
-                    tmpStr += "&";
-                else if (c=='<')
-                    tmpStr += "<";
-                else if (c=='>')
-                    tmpStr += ">";
-                else if (c < 128 && isprint(c))
-                    tmpStr += c;
-                else
-                    tmpStr += ".";
-            }
-
-        }
-    }
-
-    tmpStr += "</line>";
-
-    o.addItem(tmpStr);
-}
-
 }
 
 #endif // INCLUDED_SUB_SEQUENCE_HXX
diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
index 48b8fa9..caafc53 100644
--- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
+++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx
@@ -27,7 +27,6 @@
 #include <com/sun/star/drawing/XShape.hpp>
 #include <com/sun/star/uno/Any.hxx>
 #include <WriterFilterDllApi.hxx>
-#include <resourcemodel/OutputWithDepth.hxx>
 /**
    @file WW8ResourceModel.hxx
 


More information about the Libreoffice-commits mailing list