[Libreoffice-commits] core.git: 10 commits - filter/source include/svtools offapi/com package/inc package/source sc/source svtools/source sw/inc sw/source unusedcode.easy

Caolán McNamara caolanm at redhat.com
Thu Oct 23 03:13:57 PDT 2014


 filter/source/graphicfilter/eos2met/eos2met.cxx       |    2 
 filter/source/msfilter/svdfppt.cxx                    |   50 -
 include/svtools/parhtml.hxx                           |    9 
 offapi/com/sun/star/packages/XDataSinkEncrSupport.idl |    7 
 package/inc/ZipPackageStream.hxx                      |    4 
 package/source/zippackage/ZipPackageStream.cxx        |    4 
 sc/source/filter/lotus/lotform.cxx                    |    4 
 sc/source/filter/starcalc/scflt.cxx                   |   39 -
 svtools/source/svhtml/parhtml.cxx                     |  107 ---
 sw/inc/hintids.hxx                                    |   12 
 sw/source/core/unocore/unotext.cxx                    |    6 
 sw/source/filter/basflt/fltshell.cxx                  |  620 ------------------
 sw/source/filter/inc/fltshell.hxx                     |  247 -------
 sw/source/filter/ww8/ww8par.cxx                       |    4 
 unusedcode.easy                                       |    1 
 15 files changed, 80 insertions(+), 1036 deletions(-)

New commits:
commit 8133dc3d9abc647f52f80199b5110bc90758217c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 09:18:00 2014 +0100

    RES_FLTR_NUMRULE_NUM, RES_FLTR_SDR_ANCHOR, etc unused
    
    Change-Id: I69b550d38dcafba3bacf438711cb6c3d20483065

diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index f47b404..4bcde23 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -345,16 +345,11 @@ RES_MSG_END
 enum RES_FLTRATTR
 {
     RES_FLTRATTR_BEGIN = RES_MSG_END,
-    RES_FLTR_STYLESHEET = RES_FLTRATTR_BEGIN,
-    RES_FLTR_BOOKMARK,
+    RES_FLTR_BOOKMARK = RES_FLTRATTR_BEGIN,
     RES_FLTR_ANCHOR,
-    RES_FLTR_BORDER,
     RES_FLTR_NUMRULE,
-    RES_FLTR_NUMRULE_NUM,
-    RES_FLTR_SDR_ANCHOR,
     RES_FLTR_TOX,
     RES_FLTR_REDLINE,
-    RES_FLTR_SCRIPTTYPE,
     RES_FLTRATTR_END
 };
 
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 9c05880..482ffc7 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -513,8 +513,6 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
             }
         }
         break;
-    case RES_FLTR_STYLESHEET:
-        break;
 
     case RES_TXTATR_FIELD:
     case RES_TXTATR_ANNOTATION:
@@ -552,8 +550,6 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
         }
         break;
 
-    case RES_FLTR_NUMRULE_NUM:
-        break;
     case RES_FLTR_BOOKMARK:
         {
             SwFltBookmark* pB = (SwFltBookmark*)rEntry.pAttr;
commit 3f89f88651f2c0b0c2edf37d9f13c4e48592091c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 09:16:08 2014 +0100

    callcatcher: lots more unused post ww1 filter removal
    
    Change-Id: I7bf6dc1d366093e797a19a8e555103c15b311ac8

diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx
index ed4f4c3..920c3b2 100644
--- a/include/svtools/parhtml.hxx
+++ b/include/svtools/parhtml.hxx
@@ -241,15 +241,6 @@ public:
                 ::com::sun::star::document::XDocumentProperties>&,
             SvKeyValueIterator* );
 
-    // Ist der uebergebene 0-terminierte String (vermutlich) der Anfang
-    // eines HTML-Files? Er sollte mind. 80 Zeichen lang sein.
-    // Mit Ausnahme des Falls, dass SwitchToUCS2==false und
-    // SVPAR_CS_DONTKNOW uebergeben wird muss der String mit zwei(!)
-    // 0-Bytes an einer geraden(!) Position terminiert sein.
-    static bool IsHTMLFormat( const sal_Char* pHeader,
-                      bool bSwitchToUCS2 = false,
-                      rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
-
     bool ParseScriptOptions( OUString& rLangString, const OUString&, HTMLScriptLanguage& rLang,
                              OUString& rSrc, OUString& rLibrary, OUString& rModule );
 
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 47f7701..2f231ad 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -1843,113 +1843,6 @@ int HTMLParser::FilterListing( int nToken )
     return nToken;
 }
 
-bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
-                               bool bSwitchToUCS2,
-                               rtl_TextEncoding eEnc )
-{
-    // If the string matches one of the following regular expressions then
-    // the document is a HTML document.
-
-    // ^[^<]*<[^ \t]*[> \t]
-    //        -------
-    // ^<!
-
-    // where the underlined subexpression has to be a HTML token
-    OString sCmp;
-    bool bUCS2B = false;
-    if( bSwitchToUCS2 )
-    {
-        if( 0xfeU == (unsigned char)pHeader[0] &&
-            0xffU == (unsigned char)pHeader[1] )
-        {
-            eEnc = RTL_TEXTENCODING_UCS2;
-            bUCS2B = true;
-        }
-        else if( 0xffU == (unsigned char)pHeader[0] &&
-                 0xfeU == (unsigned char)pHeader[1] )
-        {
-            eEnc = RTL_TEXTENCODING_UCS2;
-        }
-    }
-    if
-       (
-        RTL_TEXTENCODING_UCS2 == eEnc &&
-        (
-         (0xfe == (unsigned char)pHeader[0] && 0xff == (unsigned char)pHeader[1]) ||
-         (0xff == (unsigned char)pHeader[0] && 0xfe == (unsigned char)pHeader[1])
-        )
-       )
-    {
-        if( 0xfe == (unsigned char)pHeader[0] )
-            bUCS2B = true;
-
-        sal_Int32 nLen = 2;
-        while( pHeader[nLen] != 0 || pHeader[nLen+1] != 0 )
-             nLen += 2;
-
-        OStringBuffer sTmp( (nLen - 2)/2 );
-        for( sal_Int32 nPos = 2; nPos < nLen; nPos += 2 )
-        {
-            sal_Unicode cUC;
-            if( bUCS2B )
-                cUC = (sal_Unicode(pHeader[nPos]) << 8) | pHeader[nPos+1];
-            else
-                cUC = (sal_Unicode(pHeader[nPos+1]) << 8) | pHeader[nPos];
-            if( 0U == cUC )
-                break;
-
-            sTmp.append( cUC < 256U ? (sal_Char)cUC : '.' );
-        }
-        sCmp = sTmp.makeStringAndClear();
-    }
-    else
-    {
-        sCmp = pHeader;
-    }
-
-    sCmp = sCmp.toAsciiLowerCase();
-
-    // A HTML document must have a '<' in the first line
-    sal_Int32 nStart = sCmp.indexOf('<');
-    if (nStart == -1)
-        return false;
-    nStart++;
-
-    // followed by arbitrary characters followed by a blank or '>'
-    sal_Char c;
-    sal_Int32 nPos;
-    for( nPos = nStart; nPos < sCmp.getLength(); ++nPos )
-    {
-        if( '>'==(c=sCmp[nPos]) || HTML_ISSPACE(c) )
-            break;
-    }
-
-    // If the document ends after < it's no HTML
-    if( nPos==nStart )
-        return false;
-
-    // the string following '<' has to be a known HTML token.
-    // <DIR> is not interpreted as HTML. Otherwise the output of the DOS command "DIR"
-    // could be interpreted as HTML.
-    OUString sTest(OStringToOUString(sCmp.copy(nStart, nPos-nStart), RTL_TEXTENCODING_ASCII_US));
-    int nTok = GetHTMLToken( sTest );
-    if( 0 != nTok && HTML_DIRLIST_ON != nTok )
-        return true;
-
-    // "<!" at the very beginning of the file?
-    if( nStart == 1 && '!' == sCmp[1] )
-        return true;
-
-    // <HTML> somewhere in the first 80 characters of the document
-    nStart = sCmp.indexOf(OOO_STRING_SVTOOLS_HTML_html);
-    if( nStart>0 && '<'==sCmp[nStart-1] &&
-        nStart+4 < sCmp.getLength() && '>'==sCmp[nStart+4] )
-        return true;
-
-    // Else it's rather not a HTML document
-    return false;
-}
-
 bool HTMLParser::InternalImgToPrivateURL( OUString& rURL )
 {
     if( rURL.getLength() < 19 || 'i' != rURL[0] ||
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 5774ffb..f47b404 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -344,7 +344,7 @@ RES_MSG_END
 // new attributes!)
 enum RES_FLTRATTR
 {
-RES_FLTRATTR_BEGIN = RES_MSG_END,
+    RES_FLTRATTR_BEGIN = RES_MSG_END,
     RES_FLTR_STYLESHEET = RES_FLTRATTR_BEGIN,
     RES_FLTR_BOOKMARK,
     RES_FLTR_ANCHOR,
@@ -353,10 +353,9 @@ RES_FLTRATTR_BEGIN = RES_MSG_END,
     RES_FLTR_NUMRULE_NUM,
     RES_FLTR_SDR_ANCHOR,
     RES_FLTR_TOX,
-    RES_FLTR_SECTION,
     RES_FLTR_REDLINE,
     RES_FLTR_SCRIPTTYPE,
-RES_FLTRATTR_END
+    RES_FLTRATTR_END
 };
 
 #define RES_TBX_DUMMY RES_FLTRATTR_END + 1
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 6e97e7c..9c05880 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -631,13 +631,6 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
                 pNd->SetAttr( aBkSet );
         }
         break;
-    case RES_FLTR_SECTION:
-        MakePoint(rEntry, pDoc, aRegion);   // so far always Point==Mark
-        pDoc->InsertSwSection(aRegion,
-                *(static_cast<SwFltSection*>(rEntry.pAttr))->GetSectionData(),
-                0, 0, false);
-        delete (((SwFltSection*)rEntry.pAttr)->GetSectionData());
-        break;
     case RES_FLTR_REDLINE:
         {
             if (rEntry.MakeRegion(pDoc, aRegion, true))
@@ -982,328 +975,17 @@ SfxPoolItem* SwFltTOX::Clone(SfxItemPool*) const
     return new SwFltTOX(*this);
 }
 
-// methods of SwFltSwSection follow
-SwFltSection::SwFltSection(SwSectionData *const pSect)
-    : SfxPoolItem(RES_FLTR_SECTION)
-    , m_pSection(pSect)
-{
-}
-
-SwFltSection::SwFltSection(const SwFltSection& rCpy)
-    : SfxPoolItem(RES_FLTR_SECTION)
-    , m_pSection(rCpy.m_pSection)
-{
-}
-
-bool SwFltSection::operator==(const SfxPoolItem& rItem) const
-{
-    return m_pSection == ((SwFltSection&)rItem).m_pSection;
-}
-
-SfxPoolItem* SwFltSection::Clone(SfxItemPool*) const
-{
-    return new SwFltSection(*this);
-}
-
-// here starts code generated by mdt. this is a shell, if possible, soon for
-// all filters. the whole trouble of inserting texts and formatting attributes,
-// manage positions, styles & headers/footers etc.
-
-SwFltShell::SwFltShell(SwDoc* pDoc, SwPaM& rPaM, const OUString& rBaseURL, bool bNew, sal_uLong nFieldFl) :
-    pCurrentPageDesc(0),
-    pSavedPos(0),
-    eSubMode(None),
-    nAktStyle(0),
-    aStack(pDoc, nFieldFl),
-    aEndStack(pDoc, nFieldFl),
-    pPaM(new SwPaM(*(rPaM.GetPoint()))),
-    sBaseURL(rBaseURL),
-    nPageDescOffset(GetDoc().GetPageDescCnt()),
-    eSrcCharSet(RTL_TEXTENCODING_MS_1252),
-    bNewDoc(bNew),
-    bStdPD(false),
-    bProtect(false)
-{
-    memset( pColls, 0, sizeof( pColls ) );
-    pOutDoc = new SwFltOutDoc( *pDoc, pPaM, aStack, aEndStack );
-    pOut = pOutDoc;
-
-    if( !bNewDoc ){     // insert into document ?
-                        // Because only entire lines are read, lines might need
-                        // to be inserted or broken up
-        const SwPosition* pPos = pPaM->GetPoint();
-        const SwTxtNode* pSttNd = pPos->nNode.GetNode().GetTxtNode();
-        if (pPos->nContent.GetIndex() && !pSttNd->GetTxt().isEmpty())
-                                            // insert position not in empty line
-            pDoc->getIDocumentContentOperations().SplitNode( *pPos, false );        // make new line
-        if (!pSttNd->GetTxt().isEmpty())
-        {   // InsertPos not on empty line
-            pDoc->getIDocumentContentOperations().SplitNode( *pPos, false );        // new line
-            pPaM->Move( fnMoveBackward );   // go to empty line
-        }
-
-        // prohibit reading tables in footnotes / tables
-        sal_uLong nNd = pPos->nNode.GetIndex();
-        bool bReadNoTbl = 0 != pSttNd->FindTableNode() ||
-            ( nNd < pDoc->GetNodes().GetEndOfInserts().GetIndex() &&
-            pDoc->GetNodes().GetEndOfInserts().StartOfSectionIndex() < nNd );
-        if( bReadNoTbl )
-            pOutDoc->SetReadNoTable();
-    }
-    pCurrentPageDesc =  &pDoc->GetPageDesc( 0 );  // Standard
-
-}
-
-SwFltShell::~SwFltShell()
-{
-    sal_uInt16 i;
-
-    if (eSubMode == Style)
-        EndStyle();
-    if( pOutDoc->IsInTable() )          // if not properly terminated
-        EndTable();
-    if( pOutDoc->IsInFly() )
-        EndFly();
-
-    GetDoc().getIDocumentState().SetUpdateExpFldStat(true);
-    GetDoc().SetInitDBFields(true);
-    aStack.SetAttr(*pPaM->GetPoint(), 0, false);
-    aStack.SetAttr(*pPaM->GetPoint(), 0, false);
-    aEndStack.SetAttr(*pPaM->GetPoint(), 0, false);
-    aEndStack.SetAttr(*pPaM->GetPoint(), 0, false);
-    if( bProtect ){     // The entire document is supposed to be protected
-
-        SwDoc& rDoc = GetDoc();
-                        // 1. Create SectionFmt and Section
-        SwSectionFmt* pSFmt = rDoc.MakeSectionFmt( 0 );
-        SwSectionData aSectionData(CONTENT_SECTION, OUString("PMW-Protect"));
-        aSectionData.SetProtectFlag( true );
-                        // 2. Look up Start- and EndIdx
-        const SwNode* pEndNd = &rDoc.GetNodes().GetEndOfContent();
-        SwNodeIndex aEndIdx( *pEndNd, -1L );
-        const SwStartNode* pSttNd = pEndNd->StartOfSectionNode();
-        SwNodeIndex aSttIdx( *pSttNd, 1L );         // +1 -> insert after StartNode
-                                                    // Section
-                        // insert Section
-        rDoc.GetNodes().InsertTextSection(
-                aSttIdx, *pSFmt, aSectionData, 0, &aEndIdx, false );
-
-        if( !IsFlagSet(SwFltControlStack::DONT_HARD_PROTECT) ){
-            SwDocShell* pDocSh = rDoc.GetDocShell();
-            if( pDocSh )
-                pDocSh->SetReadOnlyUI( true );
-        }
-    }
-        // Update document page descriptors (only this way also left
-        // pages get adjusted)
-
-    GetDoc().ChgPageDesc( 0, GetDoc().GetPageDesc( 0 ));    // PageDesc "Standard"
-    for (i=nPageDescOffset;i<GetDoc().GetPageDescCnt();i++)
-    {
-        const SwPageDesc& rPD = GetDoc().GetPageDesc(i);
-        GetDoc().ChgPageDesc(i, rPD);
-    }
-
-    delete pPaM;
-    for (i=0; i<sizeof(pColls)/sizeof(*pColls); i++)
-        delete pColls[i];
-    delete pOutDoc;
-}
-
-SwFltShell& SwFltShell::operator << ( const OUString& rStr )
-{
-    OSL_ENSURE(eSubMode != Style, "char insert while in style-mode");
-    GetDoc().getIDocumentContentOperations().InsertString( *pPaM, rStr );
-    return *this;
-}
-
-OUString SwFltShell::ConvertUStr(const OUString& rInOut)
-{
-    return GetAppCharClass().uppercase(rInOut);
-}
-
-// QuoteString() translates CRs to '\n' or "\0x0d", depending on nFieldIniFlags
-OUString SwFltShell::QuoteStr( const OUString& rIn )
-{
-    OUStringBuffer sOut( rIn );
-    bool bAllowCr = aStack.IsFlagSet( SwFltControlStack::ALLOW_FLD_CR );
-
-    for( sal_Int32 n = 0; n < sOut.getLength(); ++n )
-    {
-        switch( sOut[ n ] )
-        {
-        case 0x0a:
-            sOut.remove( n, 1 );             // 0xd 0xa becomes \n
-            break;
-
-        case 0x0b:
-        case 0x0c:
-        case 0x0d:
-            if( bAllowCr )
-                sOut[n] = '\n';
-            break;
-        }
-    }
-    return sOut.makeStringAndClear();
-}
-
-SwFltShell& SwFltShell::operator << ( const sal_Unicode c )
-{
-    OSL_ENSURE( eSubMode != Style, "char insert while in style-mode");
-    GetDoc().getIDocumentContentOperations().InsertString( *pPaM, OUString(c) );
-    return *this;
-}
-
-SwFltShell& SwFltShell::AddError( const sal_Char* pErr )
-{
-    OUString aName("ErrorTag");
-    SwFieldType* pFT = GetDoc().getIDocumentFieldsAccess().GetFldType( RES_SETEXPFLD, aName, false );
-    if( pFT == 0)
-    {
-        SwSetExpFieldType aS(&GetDoc(), aName, nsSwGetSetExpType::GSE_STRING);
-        pFT = GetDoc().getIDocumentFieldsAccess().InsertFldType(aS);
-    }
-    SwSetExpField aFld( (SwSetExpFieldType*)pFT,
-                        OUString::createFromAscii( pErr ));
-    //, VVF_INVISIBLE
-    GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM, SwFmtFld(aFld), 0);
-    return *this;
-}
-
-SwFltShell& SwFltShell::operator << (Graphic& rGraphic)
-{
-    // embedded image !!
-    GetDoc().getIDocumentContentOperations().Insert(*pPaM, OUString(), OUString(), &rGraphic, NULL, NULL, NULL);
-    return *this;
-}
-
-void SwFltShell::NextParagraph()
-{
-    GetDoc().getIDocumentContentOperations().AppendTxtNode(*pPaM->GetPoint());
-}
-
-void SwFltShell::NextPage()
-{
-    NextParagraph();
-    GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM,
-        SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK), 0);
-}
-
-SwFltShell& SwFltShell::AddGraphic( const OUString& rPicName )
-{
-    // embedded:
-    GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-    Graphic aGraphic;
-    // one of: GFF_NOT GFF_BMP GFF_GIF GFF_JPG GFF_PCD GFF_PCX GFF_PNG
-    // GFF_TIF GFF_XBM GFF_DXF GFF_MET GFF_PCT GFF_SGF GFF_SVM GFF_WMF
-    // GFF_SGV GFF_XXX
-    INetURLObject aDir(
-        URIHelper::SmartRel2Abs(
-            INetURLObject(GetBaseURL()), rPicName,
-            URIHelper::GetMaybeFileHdl()) );
-    switch (rFilter.ImportGraphic(aGraphic, aDir))
-    {
-        case GRFILTER_OK:
-            *this << aGraphic;
-            break;
-        case GRFILTER_OPENERROR:
-        case GRFILTER_IOERROR:
-        case GRFILTER_FORMATERROR:
-        case GRFILTER_VERSIONERROR:
-        case GRFILTER_FILTERERROR:
-        case GRFILTER_ABORT:
-        case GRFILTER_TOOBIG:
-        default:
-            AddError( "picture import error" );
-            break;
-    }
-    return *this;
-}
-
-SwFltShell& SwFltShell::SetStyle( sal_uInt16 nStyle )
-{
-    SwFltFormatCollection* p = pColls[ nStyle ];
-
-    if (p)
-    {
-        if( !pOutDoc->IsInTable() && nStyle != nAktStyle )
-        {
-            if( pColls[nAktStyle]->IsInFly() && pOutDoc->IsInFly() )
-                pOutDoc->EndFly();
-            if( p->IsInFly() )
-                p->BeginStyleFly( pOutDoc );
-        }
-        GetDoc().SetTxtFmtColl(*pPaM, p->GetColl());
-        nAktStyle = nStyle;
-    }
-    else
-    {
-        OSL_FAIL( "Invalid SwFltStyleCode" );
-    }
-    return *this;
-}
-
-SwFltShell& SwFltShell::operator << (SwFltBookmark& aBook)
-{
-    aBook.maName = ConvertUStr( aBook.maName );
-    aBook.maVal = QuoteStr(aBook.maVal);
-    aEndStack.NewAttr(*pPaM->GetPoint(), aBook);
-    return *this;
-}
-
-void SwFltShell::SetBookEnd(long nHandle)
-{
-    aEndStack.SetAttr( *pPaM->GetPoint(), RES_FLTR_BOOKMARK, true, nHandle );
-}
-
-SwFltShell& SwFltShell::EndItem( sal_uInt16 nAttrId )
-{
-    switch( nAttrId )
-    {
-    case RES_FLTR_BOOKMARK:
-        OSL_FAIL( "Wrong invocation for bookmark end" );
-        break;
-
-    case RES_FLTR_TOX:
-        aEndStack.SetAttr(*pPaM->GetPoint(), nAttrId);
-        break;
-
-    default:
-        aStack.SetAttr(*pPaM->GetPoint(), nAttrId);
-        break;
-    }
-    return *this;
-}
-
-SwFltShell& SwFltShell::operator << (const SwField& rField)
-{
-    GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM, SwFmtFld(rField), 0);
-    return *this;
-}
-
 /*virtual*/ SwFltOutBase& SwFltOutDoc::operator << (const SfxPoolItem& rItem)
 {
     rStack.NewAttr(*pPaM->GetPoint(), rItem);
     return *this;
 }
 
-/*virtual*/ SwFltOutBase& SwFltFormatCollection::operator <<
-                                (const SfxPoolItem& rItem)
-{
-    pColl->SetFmtAttr(rItem);
-    return *this;
-}
-
 const SfxPoolItem& SwFltOutDoc::GetAttr(sal_uInt16 nWhich)
 {
     return *rStack.GetFmtAttr(*pPaM->GetPoint(), nWhich);
 }
 
-const SfxPoolItem& SwFltFormatCollection::GetAttr(sal_uInt16 nWhich)
-{
-    return GetColl()->GetFmtAttr(nWhich);   // with Parents
-}
-
 // GetNodeOrStyAttr fetches attributes for toggle and modify attributes:
 // For format definitions, the current style with parents is
 // consulted, otherwise the node with parents.
@@ -1317,66 +999,6 @@ const SfxPoolItem& SwFltOutDoc::GetNodeOrStyAttr(sal_uInt16 nWhich)
         return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
 }
 
-const SfxPoolItem& SwFltFormatCollection::GetNodeOrStyAttr(sal_uInt16 nWhich)
-{
-    return GetColl()->GetFmtAttr(nWhich);   // with Parents
-}
-
-const SfxPoolItem& SwFltShell::GetNodeOrStyAttr(sal_uInt16 nWhich)
-{
-    return pOut->GetNodeOrStyAttr( nWhich );
-}
-
-const SfxPoolItem& SwFltShell::GetAttr(sal_uInt16 nWhich)
-{
-    return pOut->GetAttr( nWhich );
-}
-
-const SfxPoolItem& SwFltShell::GetFlyFrmAttr(sal_uInt16 nWhich)
-{
-    return pOut->GetFlyFrmAttr( nWhich );
-}
-
-SwFieldType* SwFltShell::GetSysFldType(sal_uInt16 eWhich)
-{
-    return GetDoc().getIDocumentFieldsAccess().GetSysFldType(eWhich);
-}
-
-bool SwFltShell::GetWeightBold()
-{
-    return ((SvxWeightItem&)GetNodeOrStyAttr(RES_CHRATR_WEIGHT)).GetWeight()
-                                != WEIGHT_NORMAL;
-}
-
-bool SwFltShell::GetPostureItalic()
-{
-    return ((SvxPostureItem&)GetNodeOrStyAttr(RES_CHRATR_POSTURE)).GetPosture()
-                                != ITALIC_NONE;
-}
-
-bool SwFltShell::GetCrossedOut()
-{
-    return ((SvxCrossedOutItem&)GetNodeOrStyAttr(RES_CHRATR_CROSSEDOUT))
-                                    .GetStrikeout() != STRIKEOUT_NONE;
-}
-
-bool SwFltShell::GetContour()
-{
-    return ((SvxContourItem&)GetNodeOrStyAttr(RES_CHRATR_CONTOUR)).GetValue();
-}
-
-bool SwFltShell::GetCaseKapitaelchen()
-{
-    return ((SvxCaseMapItem&)GetNodeOrStyAttr(RES_CHRATR_CASEMAP))
-                                    .GetCaseMap() == SVX_CASEMAP_KAPITAELCHEN;
-}
-
-bool SwFltShell::GetCaseVersalien()
-{
-    return ((SvxCaseMapItem&)GetNodeOrStyAttr(RES_CHRATR_CASEMAP))
-                                    .GetCaseMap() == SVX_CASEMAP_VERSALIEN;
-}
-
 // Tables
 SwFltOutBase::~SwFltOutBase()
 {
@@ -1896,244 +1518,6 @@ void SwFltOutDoc::EndFly()
     pFly = 0;
 }
 
-/*virtual*/ bool SwFltFormatCollection::IsInFly()
-{
-    return bHasFly;
-};
-
-/*virtual*/ void SwFltFormatCollection::SetFlyFrmAttr(const SfxPoolItem& rAttr)
-{
-    if (!pFlyAttrs)
-        pFlyAttrs = new SfxItemSet( GetDoc().GetAttrPool(),
-                             RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
-    pFlyAttrs->Put( rAttr );
-}
-
-/*virtual*/ const SfxPoolItem& SwFltFormatCollection::GetFlyFrmAttr(sal_uInt16 nWhich)
-{
-    if( pFlyAttrs )
-        return pFlyAttrs->Get( nWhich, false );
-    else
-        return GetDoc().GetAttrPool().GetDefaultItem(nWhich);
-}
-
-bool SwFltFormatCollection::BeginFly( RndStdIds eAnchor,
-                                      bool bAbsolutePos,
-                                      const SfxItemSet* pMoreAttrs)
-
-{
-    SwFltOutBase::BeginFly( eAnchor, bAbsolutePos, pMoreAttrs );
-    bHasFly = true;
-    return true;
-}
-
-void SwFltFormatCollection::EndFly()    // never gets called
-{
-}
-
-bool SwFltFormatCollection::BeginStyleFly( SwFltOutDoc* pOutDoc )
-{
-    OSL_ENSURE( pOutDoc, "BeginStyleFly without pOutDoc" );
-    OSL_ENSURE( pOutDoc && !pOutDoc->IsInFly(), "BeginStyleFly in Fly" );
-    if( pOutDoc && !pOutDoc->IsInFly() )
-        return pOutDoc->BeginFly( eFlyAnchor, bFlyAbsPos, pFlyAttrs );
-    else
-        return false;
-}
-
-bool SwFltShell::BeginFly( RndStdIds eAnchor,
-                           bool bAbsolutePos)
-{
-    if (pOut->IsInFly()){
-        OSL_FAIL("BeginFly in Fly");
-        return false;
-    }
-    if (pOutDoc->IsInTable()){
-        OSL_FAIL("BeginFly in Table");
-        return false;
-    }
-    pOut->BeginFly( eAnchor, bAbsolutePos, pColls[nAktStyle]->GetpFlyAttrs() );
-    eSubMode = Fly;
-    return true;
-}
-
-void SwFltShell::SetFlyXPos( short nXPos, sal_Int16 eHRel,
-                             sal_Int16 eHAlign)
-{
-    SetFlyFrmAttr( SwFmtHoriOrient( nXPos, eHAlign, eHRel ) );
-}
-
-void SwFltShell::SetFlyYPos( short nYPos, sal_Int16 eVRel,
-                             sal_Int16 eVAlign)
-{
-    SetFlyFrmAttr( SwFmtVertOrient( nYPos, eVAlign, eVRel ) );
-}
-
-void SwFltShell::EndFly()
-{
-    if (!pOut->IsInFly()){
-        OSL_FAIL("EndFly without Fly");
-        return;
-    }
-    if (pOutDoc->IsInTable()){      // Table intermingled with Fly doesn't make sense
-        OSL_FAIL("EndFly in Table ( intermingled )");
-        EndTable();
-    }
-    pOut->EndFly();
-    eSubMode = None;
-}
-
-void SwFltShell::BeginFootnote()
-{
-    if( pOut->IsInFly() ){          // Happens at footnote in Fly, among others
-        OSL_FAIL("Footnote in Fly not permitted");
-        return;
-    }
-    if( pOutDoc->IsInTable() ){
-        OSL_FAIL("Footnote in table currently not allowed");
-        return;
-    }
-
-    // Close all attributes, because otherwise attributes extending into
-    // footnotes might be created
-    aStack.SetAttr( *pPaM->GetPoint(), 0, false );
-    //  Don't force-close EndStack for now, so bookmarks on footnotes can
-    //  be applied to PMW
-
-    SwFmtFtn aFtn;
-    GetDoc().getIDocumentContentOperations().InsertPoolItem(*pPaM, aFtn, 0);
-    OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
-    pSavedPos = new SwPosition(*pPaM->GetPoint());
-    pPaM->Move(fnMoveBackward, fnGoCntnt);
-    SwTxtNode* pTxt = pPaM->GetNode().GetTxtNode();
-    SwTxtAttr *const pFN = pTxt->GetTxtAttrForCharAt(
-        pPaM->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN);
-    if( !pFN ){         // Happens at footnote in Fly, among others
-        OSL_ENSURE(pFN, "Problems with creating footnote text");
-        return;
-    }
-    const SwNodeIndex* pStartIndex = ((SwTxtFtn*)pFN)->GetStartNode();
-    OSL_ENSURE(pStartIndex, "Problems with creating footnote text");
-    pPaM->GetPoint()->nNode = pStartIndex->GetIndex() + 1;
-    pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
-    eSubMode = Footnote;
-}
-
-void SwFltShell::EndFootnote()
-{
-    if(!pSavedPos)
-        return;
-    // Close all attributes, because otherwise
-    // attributes extending out of footnotes might
-    // be created
-    aStack.SetAttr( *pPaM->GetPoint(), 0, false );
-    //  Don't force-close EndStack for now, so bookmarks on footnotes can
-    //  be applied to PMW
-
-    *pPaM->GetPoint() = *pSavedPos;             // restore Cursor
-    delete pSavedPos;
-    pSavedPos = 0;
-}
-
-void SwFltShell::BeginHeader(SwPageDesc* /*pPD*/)
-{
-    SwFrmFmt* pFmt = &pCurrentPageDesc->GetMaster();
-    SwFrmFmt* pHdFtFmt;
-    pFmt->SetFmtAttr(SwFmtHeader(true));
-    pHdFtFmt = (SwFrmFmt*)pFmt->GetHeader().GetHeaderFmt();
-    const SwNodeIndex* pStartIndex = pHdFtFmt->GetCntnt().GetCntntIdx();
-    if (!pStartIndex)
-        return;
-    OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
-    pSavedPos = new SwPosition(*pPaM->GetPoint());
-    pPaM->GetPoint()->nNode = pStartIndex->GetIndex() + 1;
-    pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
-    eSubMode = Header;
-}
-
-void SwFltShell::BeginFooter(SwPageDesc* /*pPD*/)
-{
-    SwFrmFmt* pFmt =  &pCurrentPageDesc->GetMaster();
-    SwFrmFmt* pHdFtFmt;
-    pFmt->SetFmtAttr(SwFmtFooter(true));
-    pHdFtFmt = (SwFrmFmt*)pFmt->GetFooter().GetFooterFmt();
-    const SwNodeIndex* pStartIndex = pHdFtFmt->GetCntnt().GetCntntIdx();
-    if (!pStartIndex)
-        return;
-    OSL_ENSURE(pSavedPos == NULL, "SwFltShell");
-    pSavedPos = new SwPosition(*pPaM->GetPoint());
-    pPaM->GetPoint()->nNode = pStartIndex->GetIndex() + 1;
-    pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0);
-    eSubMode = Footer;
-}
-
-void SwFltShell::EndHeaderFooter()
-{
-    *pPaM->GetPoint() = *pSavedPos;             // restore Cursor
-    delete pSavedPos;
-    pSavedPos = 0;
-}
-
-SwPageDesc* SwFltShell::MakePageDesc(SwPageDesc* pFirstPageDesc)
-{
-    if(bStdPD)                      // no new PageDescs
-        return pCurrentPageDesc;
-
-    bool bFollow = (pFirstPageDesc != 0);
-    SwPageDesc* pNewPD;
-    if (bFollow && pFirstPageDesc->GetFollow() != pFirstPageDesc)
-        return pFirstPageDesc;      // Error: already has Follow
-    // Detection of duplicate names still missing (low probability of this
-    // actually occurring)
-
-    pNewPD = GetDoc().MakePageDesc(
-            SwViewShell::GetShellRes()->GetPageDescName(GetDoc().GetPageDescCnt(), bFollow ? ShellResource::FOLLOW_PAGE : ShellResource::NORMAL_PAGE),
-            pFirstPageDesc, false);
-
-    if (bFollow)
-    {
-        // This one follows pPageDesc
-        pFirstPageDesc->SetFollow(pNewPD);
-        pNewPD->SetFollow(pNewPD);
-    }
-    else
-    {
-        GetDoc().getIDocumentContentOperations().InsertPoolItem( *pPaM, SwFmtPageDesc( pNewPD ), 0 );
-    }
-    pNewPD->WriteUseOn( // all pages
-     (UseOnPage)(nsUseOnPage::PD_ALL | nsUseOnPage::PD_HEADERSHARE | nsUseOnPage::PD_FOOTERSHARE));
-    return pNewPD;
-}
-
-SwFltFormatCollection::SwFltFormatCollection(
-    SwDoc& _rDoc, RES_POOL_COLLFMT_TYPE nType ) :
-    SwFltOutBase(_rDoc),
-    pColl(_rDoc.getIDocumentStylePoolAccess().GetTxtCollFromPool( static_cast< sal_uInt16 >(nType), false )),
-    pFlyAttrs( 0 ),
-    bHasFly( false )
-{
-    Reset();            // reset default attrs and auto flag
-}
-
-SwFltFormatCollection::SwFltFormatCollection(
-    SwDoc& _rDoc, const OUString& rName ) :
-    SwFltOutBase(_rDoc),
-    pFlyAttrs( 0 ),
-    bHasFly( false )
-{
-    pColl = _rDoc.MakeTxtFmtColl(rName, (SwTxtFmtColl*)_rDoc.GetDfltTxtFmtColl());
-    Reset();            // reset default attrs and auto flag
-}
-
-void SwFltShell::NextStyle(sal_uInt16 nWhich, sal_uInt16 nNext)
-{
-        OSL_ENSURE(pColls[nWhich], "Next style for noexistent style" );
-        OSL_ENSURE(pColls[nNext], "Next style to noexistent style" );
-        if( pColls[nWhich] && pColls[nNext] )
-            pColls[nWhich]->GetColl()->SetNextTxtFmtColl(
-                 *pColls[nNext]->GetColl() );
-}
-
 // UpdatePageDescs needs to be called at end of parsing to make Writer actually
 // accept Pagedescs contents
 void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset)
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index a39d363..8837961 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -36,7 +36,6 @@
 #include <boost/ptr_container/ptr_deque.hpp>
 
 class SwTOXBase;
-class SwFltShell;
 class SwField;
 class SwFieldType;
 class Graphic;
@@ -137,7 +136,6 @@ class SW_DLLPUBLIC SwFltControlStack : private ::boost::noncopyable
     typedef boost::ptr_deque<SwFltStackEntry> Entries;
     typedef Entries::iterator myEIter;
     Entries maEntries;
-    friend class SwFltShell;
 
     sal_uLong nFieldFlags;
     vcl::KeyCode aEmptyKeyCode; // fuer Bookmarks
@@ -270,7 +268,6 @@ public:
 class SW_DLLPUBLIC SwFltBookmark : public SfxPoolItem
 {
 private:
-    friend class SwFltShell;    // darf aName und aVal uebersetzen
 
     long mnHandle;
     OUString maName;
@@ -317,18 +314,6 @@ public:
     bool HadPageDescItem() const { return bHadPageDescItem; }
 };
 
-class SwFltSection : public SfxPoolItem
-{
-    SwSectionData * m_pSection;
-
-public:
-    SwFltSection( SwSectionData *const pSect );
-    SwFltSection( const SwFltSection& );
-    // "pure virtual Methoden" vom SfxPoolItem
-    virtual bool operator==(const SfxPoolItem&) const SAL_OVERRIDE;
-    virtual SfxPoolItem* Clone(SfxItemPool* = 0) const SAL_OVERRIDE;
-    SwSectionData * GetSectionData()    { return m_pSection; }
-};
 // Der WWEndStack verhaelt sich wie der WWControlStck, nur dass die Attribute
 // auf ihm bis ans Ende des Dokuments gehortet werden, falls auf sie noch
 // zugegriffen werden muss (z.B. Book/RefMarks, Index u.s.w.)
@@ -459,238 +444,6 @@ public:
     virtual void EndFly() SAL_OVERRIDE;
 };
 
-class SwFltFormatCollection : public SwFltOutBase
-{
-    SwTxtFmtColl* pColl;
-    SfxItemSet* pFlyAttrs;      // Simulation der Flys in Styles
-    bool bHasFly;
-public:
-    SwFltFormatCollection(SwDoc&, RES_POOL_COLLFMT_TYPE nType);
-    SwFltFormatCollection(SwDoc&, const OUString& rName );
-    virtual ~SwFltFormatCollection() { if( pFlyAttrs ) delete pFlyAttrs; }
-
-    void Reset()
-    {
-        // #i73790# - method renamed
-        pColl->ResetAllFmtAttr();
-        pColl->SetAuto(false); // nach Empfehlung JP
-    }
-    void Derived(SwTxtFmtColl* pBase)
-        { pColl->SetDerivedFrom(pBase); }
-
-//  SwTxtFmtColl* Search(String, CharSet eSrc);
-    SwTxtFmtColl* GetColl()         { return pColl; }
-    void SetHasFly()                { bHasFly = true; }
-    SfxItemSet* GetpFlyAttrs()      { return pFlyAttrs; }
-
-    virtual SwFltOutBase& operator << (const SfxPoolItem& rItem) SAL_OVERRIDE;
-    virtual const SfxPoolItem& GetAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
-    virtual const SfxPoolItem& GetNodeOrStyAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
-
-    virtual bool IsInFly() SAL_OVERRIDE;
-    virtual void SetFlyFrmAttr(const SfxPoolItem& rAttr) SAL_OVERRIDE;
-    virtual const SfxPoolItem& GetFlyFrmAttr(sal_uInt16 nWhich) SAL_OVERRIDE;
-    virtual bool BeginFly( RndStdIds eAnchor, bool bAbsolutePos,
-                               const SfxItemSet* pMoreAttrs = 0 ) SAL_OVERRIDE;
-    bool BeginStyleFly( SwFltOutDoc* pOutDoc );
-    virtual void EndFly() SAL_OVERRIDE;
-};
-
-// dies nun ist die zauberhafteklasse: intention: alle eins nach dem
-// andern hinein'pipe'n. wird eine besondere struktur eingelesen, wird
-// eine klammer geoeffnet (BeginXxx) und nach beendigung geschlossen
-// (EndXxx), wobei Xxx zB fuer Fusznoten, Kopf/Fuszzeilen oder
-// Tabellen steht. Styles funktionieren auch so, haben aber den
-// unterschied, keine buchstaben zu akzeptieren.
-// beginnt ein neuer absatz oder aehnliches, wird NextXxx genutzt.
-// hier ist moeglich, Tab, Zeilenumbruch, Absatzende, Seitenumbruch
-// und Sektionsende einzufuegen.
-
-class SwFltShell
-{
-    SwFltOutDoc* pOutDoc;
-    SwFltFormatCollection* pColls[256];
-    SwFltOutBase* pOut;
-
-//  SwFltFormatCollection* pFormat; // set when in style-mode
-    SwPageDesc* pCurrentPageDesc;
-    SwPosition* pSavedPos; // set, when in footnote or header/footer -mode
-#ifdef None
-#undef None
-#endif
-    enum SubModes {
-        None,
-        Header,
-        Footer,
-        Footnote,
-        Table,
-        Fly,
-        Style,
-        Max
-    } eSubMode;
-
-// Fly items:
-    sal_uInt16 nAktStyle;               // zur Indizierung pStyleFlyTable
-
-    SwFltControlStack aStack;
-    SwFltEndStack aEndStack;
-    SwPaM* pPaM;
-
-    OUString sBaseURL;
-    sal_uInt16 nPageDescOffset; // fuers update der pagedescs
-    rtl_TextEncoding eSrcCharSet; // charset der quelle
-    friend class SwFltControlStack;
-    bool bNewDoc;
-    bool bStdPD;
-    bool bProtect;
-
-public:
-    SwFltShell(SwDoc* , SwPaM& , const OUString& rBaseURL, bool bNew, sal_uLong = 0);
-    ~SwFltShell();
-
-    SwDoc& GetDoc()                 { return *aStack.pDoc; }
-
-    rtl_TextEncoding SetCharSet(rtl_TextEncoding eNew)    { rtl_TextEncoding eOld = eSrcCharSet;
-                                          eSrcCharSet = eNew;
-                                          return eOld;
-                                        }
-    void SetUseStdPageDesc()        { bStdPD = true; }
-    void SetProtect()               { bProtect = true; }
-    SwPageDesc* MakePageDesc(SwPageDesc* pFirstPageDesc = NULL);
-    SwPageDesc& GetPageDesc()       { return *pCurrentPageDesc; }
-    void NextTab()                  { (*this) << sal_uInt8(0x09); }
-    void NextLine()                 { (*this) << sal_uInt8(0x0a); }
-    void NextParagraph();
-    void NextPage();
-    void NextSection()      { pCurrentPageDesc = MakePageDesc(); }
-
-    SwFltShell& AddGraphic( const OUString& rPicName );
-    SwFltShell& AddError( const sal_Char* pErr );
-    SwFltShell& EndItem( sal_uInt16 nId );
-    SwFltShell& SetStyle( sal_uInt16 nStyle );
-
-    SwFltShell& operator << ( Graphic& );
-    SwFltShell& operator << ( SwFltBookmark& aBook );
-    void SetBookEnd(long nHandle);
-    SwFltShell& operator << ( const OUString& );  // Vorsicht: CHARSET_ANSI
-    SwFltShell& operator << ( const sal_Unicode );
-    SwFltShell& operator << ( const SwField& );
-    SwFltShell& operator << ( const SfxPoolItem& rItem )
-        { *pOut << rItem; return *this; }
-
-//  SwFltShell& operator >> (SfxPoolItem&);
-// methode zum beenden einer sub-sektion, zB Fusznote etc
-    void End()                      { eSubMode = None; }
-// methoden zur verwaltung von Header/Footer
-    void BeginHeader(SwPageDesc* =NULL);
-    void BeginFooter(SwPageDesc* =NULL);
-    void EndHeaderFooter();
-// methoden zur verwaltung von FootNotes
-    void BeginFootnote();
-    void EndFootnote();
-// methoden zur verwaltung von Tabellen
-    bool IsInTable() {
-        return ( pOut == pOutDoc ) && pOutDoc->IsInTable(); }
-    const SfxPoolItem& GetCellAttr(sal_uInt16 nWhich) {
-        return pOut->GetCellAttr(nWhich); }
-    bool BeginTable() {
-        bool b = pOut->BeginTable();
-        if(b) eSubMode = Table;
-        return b; }
-    void NextTableCell() {
-        pOut->NextTableCell(); }
-    void NextTableRow() {
-        pOut->NextTableRow(); }
-    void SetTableWidth(SwTwips nW) {
-        pOut->SetTableWidth(nW); }
-    bool IsTableWidthSet() {
-        return pOutDoc->IsTableWidthSet(); }
-    void SetTableOrient(sal_Int16 eOri) {
-        pOut->SetTableOrient(eOri); }
-    void SetCellWidth(SwTwips nWidth, sal_uInt16 nCell = USHRT_MAX ) {
-        pOut->SetCellWidth(nWidth, nCell); }
-    void SetCellHeight(SwTwips nH) {
-        pOut->SetCellHeight(nH); }
-    void SetCellBorder(const SvxBoxItem& rFmtBox, sal_uInt16 nCell = USHRT_MAX ){
-        pOut->SetCellBorder(rFmtBox, nCell); }
-    void SetCellSpace(sal_uInt16 nSp) {
-        pOut->SetCellSpace(nSp); }
-    void DeleteCell(sal_uInt16 nCell = USHRT_MAX) {
-        pOut->DeleteCell(nCell); }
-    void EndTable() {
-        pOut->EndTable(); }
-// methoden zur verwaltung von Flys
-    bool IsInFly() { return pOut->IsInFly(); }
-    bool BeginFly( RndStdIds eAnchor = FLY_AT_PARA, bool bAbsolutePos = false );
-    void SetFlyAnchor( RndStdIds eAnchor )
-        { pOut->SetFlyAnchor( eAnchor ); }
-    void SetFlyXPos( short nXPos, sal_Int16 eHRel = com::sun::star::text::RelOrientation::FRAME,
-                     sal_Int16 eHAlign = com::sun::star::text::HoriOrientation::NONE );
-    void SetFlyYPos( short nYPos, sal_Int16 eVRel = com::sun::star::text::RelOrientation::FRAME,
-                     sal_Int16 eVAlign = com::sun::star::text::VertOrientation::NONE );
-    void SetFlyFrmAttr(const SfxPoolItem& rAttr){
-        pOut->SetFlyFrmAttr( rAttr ); }
-    void EndFly();
-// methoden zur verwaltung von styles:
-    void BeginStyle(sal_uInt16 nUserCode, RES_POOL_COLLFMT_TYPE aType)
-    {
-        OSL_ENSURE(nUserCode<sizeof(pColls)/sizeof(*pColls), "code out of bounds");
-        OSL_ENSURE(pColls[nUserCode] == NULL, "user codes dublicate");
-        if (eSubMode == Style)
-            EndStyle();
-        pOut = pColls[nUserCode] = new SwFltFormatCollection(GetDoc(), aType);
-        nAktStyle = nUserCode;
-        eSubMode = Style;
-    }
-    void BeginStyle( sal_uInt16 nUserCode, const OUString& rName )
-    {
-        OSL_ENSURE(nUserCode<sizeof(pColls)/sizeof(*pColls), "code out of bounds");
-        OSL_ENSURE(pColls[nUserCode] == NULL, "user codes dublicate");
-        if (eSubMode == Style)
-            EndStyle();
-        pOut = pColls[nUserCode] = new SwFltFormatCollection(GetDoc(), rName );
-        nAktStyle = nUserCode;
-        eSubMode = Style;
-    }
-    bool IsStyleImported(sal_uInt16 nUserCode)
-        { return pColls[nUserCode] != 0; }
-    void BaseStyle(sal_uInt16 nBased)
-    {
-        OSL_ENSURE(eSubMode == Style, "wrong state for style");
-        OSL_ENSURE(pColls[nBased], "Style based on noexistent style" );
-        if( eSubMode == Style && pColls[nBased]->GetColl() )
-            ((SwFltFormatCollection*)pOut)->Derived(pColls[nBased]->GetColl());
-    }
-    void NextStyle(sal_uInt16 nWhich, sal_uInt16 nNext);
-
-    void EndStyle()
-    {
-//   OSL_ENSURE(eSubMode == Style, "wrong state for style");
-        nAktStyle = 0;
-        pOut = pOutDoc;
-        eSubMode = None;
-    }
-
-    bool IsFlagSet(SwFltControlStack::Flags no) const
-        { return aStack.IsFlagSet(no); }
-    OUString ConvertUStr(const OUString& rInOut);
-    OUString QuoteStr( const OUString& rIn );
-
-    // folgende status kann die shell verwalten:
-    const SfxPoolItem& GetNodeOrStyAttr(sal_uInt16 nWhich);
-    const SfxPoolItem& GetAttr(sal_uInt16 nWhich);
-    const SfxPoolItem& GetFlyFrmAttr(sal_uInt16 nWhich);
-    SwFieldType* GetSysFldType(sal_uInt16 eWhich);
-    bool GetWeightBold();
-    bool GetPostureItalic();
-    bool GetCrossedOut();
-    bool GetContour();
-    bool GetCaseKapitaelchen();
-    bool GetCaseVersalien();
-
-    const OUString& GetBaseURL() const { return sBaseURL; }
-};
-
 SW_DLLPUBLIC void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset);
 
 #endif
diff --git a/unusedcode.easy b/unusedcode.easy
index b1302f2..d1fa4e6 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -58,7 +58,6 @@ VCLXGraphics::getTextColor()
 VCLXGraphics::getTextFillColor()
 XclXmlUtils::ToOString(XclRange const&)
 XmlTestTools::parseXml(utl::TempFile&)
-ZipUtils::Deflater::setLevel(int)
 apitest::CellProperties::testRotateReference()
 apitest::CellProperties::testVertJustify()
 apitest::DataPilotField::testAutoShowInfo()
commit 4a32dc6562f8e38dcc8d9c970c566c6bfcd3d7e4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 10:47:15 2014 +0100

    coverity#1242682 Untrusted loop bound
    
    Change-Id: Ib9b7c148f0679e458821cf2f30ef14d815b96706

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9b10f1e..0f049a4 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -475,6 +475,10 @@ bool Sttb::Read( SvStream& rS )
     rS.ReadUInt16( fExtend ).ReadUInt16( cData ).ReadUInt16( cbExtra );
     if ( cData )
     {
+        //if they are all going to be empty strings, how many could there be
+        const size_t nMaxPossibleRecords = rS.remainingSize() / sizeof(sal_uInt16);
+        if (cData > nMaxPossibleRecords)
+            return false;
         for ( sal_Int32 index = 0; index < cData; ++index )
         {
             SBBItem aItem;
commit 04d34c63c7f988eb285366e899f899ccd7109482
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 10:43:52 2014 +0100

    coverity#1242688 Untrusted loop bound
    
    Change-Id: Ic3e2c390de22d3e998daf760d73619218da020ec

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 36524eb..0475f0c 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -4507,7 +4507,9 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP
         }
         if ( nFileOfs )
         {
-            sal_Int16   nTCount;
+            bool bRecordOk = true;
+
+            sal_Int16   nTCount(0);
             sal_Int32   i;
             rIn.ReadInt32( mpImplRuler->nFlags );
 
@@ -4518,10 +4520,16 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP
                 rIn.ReadUInt16( mpImplRuler->nDefaultTab );
             if ( mpImplRuler->nFlags & 4 )
             {
-                rIn.ReadInt16( nTCount );
-                if ( nTCount )
+                rIn.ReadInt16(nTCount);
+
+                const size_t nMaxPossibleRecords = rIn.remainingSize() / (2*sizeof(sal_uInt16));
+                const sal_uInt16 nTabCount(nTCount);
+
+                bRecordOk = nTabCount <= nMaxPossibleRecords;
+
+                if (nTCount && bRecordOk)
                 {
-                    mpImplRuler->nTabCount = (sal_uInt16)nTCount;
+                    mpImplRuler->nTabCount = nTabCount;
                     mpImplRuler->pTab = new PPTTabEntry[ mpImplRuler->nTabCount ];
                     for ( i = 0; i < nTCount; i++ )
                     {
@@ -4530,23 +4538,27 @@ PPTTextRulerInterpreter::PPTTextRulerInterpreter( sal_uInt32 nFileOfs, SdrPowerP
                     }
                 }
             }
-            for ( i = 0; i < 5; i++ )
+
+            if (bRecordOk)
             {
-                if ( mpImplRuler->nFlags & ( 8 << i ) )
-                    rIn.ReadUInt16( mpImplRuler->nTextOfs[ i ] );
-                if ( mpImplRuler->nFlags & ( 256 << i ) )
-                    rIn.ReadUInt16( mpImplRuler->nBulletOfs[ i ] );
-                if( mpImplRuler->nBulletOfs[ i ] > 0x7fff)
+                for ( i = 0; i < 5; i++ )
                 {
-                    // workaround
-                    // when bullet offset is > 0x7fff, the paragraph should look like
-                    // *    first line text
-                    // second line text
-
-                    // we add to bullet para indent 0xffff - bullet offset. it looks like
-                    // best we can do for now
-                    mpImplRuler->nTextOfs[ i ] += 0xffff - mpImplRuler->nBulletOfs[ i ];
-                    mpImplRuler->nBulletOfs[ i ] = 0;
+                    if ( mpImplRuler->nFlags & ( 8 << i ) )
+                        rIn.ReadUInt16( mpImplRuler->nTextOfs[ i ] );
+                    if ( mpImplRuler->nFlags & ( 256 << i ) )
+                        rIn.ReadUInt16( mpImplRuler->nBulletOfs[ i ] );
+                    if( mpImplRuler->nBulletOfs[ i ] > 0x7fff)
+                    {
+                        // workaround
+                        // when bullet offset is > 0x7fff, the paragraph should look like
+                        // *    first line text
+                        // second line text
+
+                        // we add to bullet para indent 0xffff - bullet offset. it looks like
+                        // best we can do for now
+                        mpImplRuler->nTextOfs[ i ] += 0xffff - mpImplRuler->nBulletOfs[ i ];
+                        mpImplRuler->nBulletOfs[ i ] = 0;
+                    }
                 }
             }
         }
commit d4617ef9c371baaadd948ffe7285d197d2d97107
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 10:32:01 2014 +0100

    coverity#1078541 Division or modulo by zero
    
    Change-Id: Iea43399c70e56ff4e32953a5ddc5751abed39ff7

diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index e7285ec..dd743c9 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -1962,7 +1962,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
                 for ( i = 0; i < aStr.getLength(); i++ )
                 {
                     aPt2 = aPt;
-                    if ( i > 0 )
+                    if (i > 0 && nNormSize)
                     {
                         aPt2.X() += pDXAry[i-1]*((long)pA->GetWidth())/ nNormSize;
                         if ( nOrientation )
commit 2083b5350055177fbb3fcef75b2be63cf26d6039
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 10:21:41 2014 +0100

    coverity#1019337 Dereference after null check
    
    Change-Id: I31584f1b204b85929a5549ecd7f7e05b6968e580

diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 7a3d869..f0c5f44 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1584,9 +1584,10 @@ SwXText::convertToTextFrame(
         // todo: if the start/end is in a table then insert a paragraph
         // before/after, move the start/end nodes, then convert and
         // remove the additional paragraphs in the end
+        SwTableNode * pStartTableNode(0);
         if (pStartStartNode->GetStartNodeType() == SwTableBoxStartNode)
         {
-            SwTableNode * pStartTableNode(pStartStartNode->FindTableNode());
+            pStartTableNode = pStartStartNode->FindTableNode();
             // Is it the same table start node than the end?
             SwTableNode *const pEndStartTableNode(pEndStartNode->FindTableNode());
             while (pEndStartTableNode && pStartTableNode &&
@@ -1595,6 +1596,9 @@ SwXText::convertToTextFrame(
                 SwStartNode* pStartStartTableNode = pStartTableNode->StartOfSectionNode();
                 pStartTableNode = pStartStartTableNode->FindTableNode();
             }
+        }
+        if (pStartTableNode)
+        {
             const SwNodeIndex aTblIdx(  *pStartTableNode, -1 );
             SwPosition aBefore(aTblIdx);
             bParaBeforeInserted = GetDoc()->getIDocumentContentOperations().AppendTxtNode( aBefore );
commit 1f581d50419d002618c48dd87017451d1915d43e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 09:36:43 2014 +0100

    coverity#1242587 Untrusted value as argument
    
    Change-Id: I9720402f6482419cee84b468dd82a8c76ca1ddf4

diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index 8303c5e..450c5fe 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -557,6 +557,10 @@ ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
                 Read( nAnz );
                 Read( nStrLen );
 
+                const size_t nMaxEntries = aIn.remainingSize();
+                if (nStrLen > nMaxEntries)
+                    nStrLen = nMaxEntries;
+
                 if( nStrLen )
                 {
                     boost::scoped_array<sal_Char> p(new (::std::nothrow) sal_Char[ nStrLen + 1 ]);
commit ea8892cb44e9e1ad7ae7bba4f32cb690a77107d2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 09:33:00 2014 +0100

    coverity#1242599 Untrusted loop bound
    
    Change-Id: I51bc114e215327f539612f94c40019c554698813

diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index af897be..8bcc346 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -2104,25 +2104,30 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
 void Sc10Import::LoadAttr(Sc10ColAttr& rAttr)
 {
     // rAttr is not reused, otherwise we'd have to delete [] rAttr.pData;
-    rStream.ReadUInt16( rAttr.Count );
-    if (rAttr.Count)
+    rStream.ReadUInt16(rAttr.Count);
+
+    const size_t nMaxEntries = rStream.remainingSize() / (sizeof(sal_uInt16) * 2);
+    if (rAttr.Count > nMaxEntries)
+        rAttr.Count = nMaxEntries;
+
+    if (!rAttr.Count)
+        return;
+
+    rAttr.pData = new (::std::nothrow) Sc10ColData[rAttr.Count];
+    if (rAttr.pData == NULL)
     {
-        rAttr.pData = new (::std::nothrow) Sc10ColData[rAttr.Count];
-        if (rAttr.pData != NULL)
-        {
-            for (sal_uInt16 i = 0; i < rAttr.Count; i++)
-            {
-                rStream.ReadUInt16( rAttr.pData[i].Row );
-                rStream.ReadUInt16( rAttr.pData[i].Value );
-            }
-            nError = rStream.GetError();
-        }
-        else
-        {
-            nError = errOutOfMemory;
-            rAttr.Count = 0;
-        }
+        nError = errOutOfMemory;
+        rAttr.Count = 0;
+        return;
+    }
+
+    for (sal_uInt16 i = 0; i < rAttr.Count; ++i)
+    {
+        rStream.ReadUInt16( rAttr.pData[i].Row );
+        rStream.ReadUInt16( rAttr.pData[i].Value );
     }
+
+    nError = rStream.GetError();
 }
 
 void Sc10Import::ChangeFormat(sal_uInt16 nFormat, sal_uInt16 nInfo, sal_uLong& nKey)
commit aa79a832b4e1fd994654c31fedf7a549de03fee4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 10:05:08 2014 +0100

    coverity#706585 Uncaught exception
    
    Change-Id: Ic8d2963536b793f0a229901d9e13d8e54842d9b9

diff --git a/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl b/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl
index 8814117..05c0cbb 100644
--- a/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl
+++ b/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl
@@ -56,6 +56,7 @@ interface XDataSinkEncrSupport: com::sun::star::uno::XInterface
      */
     ::com::sun::star::io::XInputStream getDataStream()
         raises( ::com::sun::star::packages::WrongPasswordException,
+                ::com::sun::star::packages::zip::ZipException,
                 ::com::sun::star::io::IOException );
 
 
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index d8b686e..45c008a 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -165,7 +165,7 @@ public:
 
     // XDataSinkEncrSupport
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getDataStream()
-        throw ( ::com::sun::star::packages::WrongPasswordException,
+        throw ( ::com::sun::star::packages::WrongPasswordException, ::com::sun::star::packages::zip::ZipException,
                 ::com::sun::star::io::IOException,
                 ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getRawStream()
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 37710c0..430ba00 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -516,7 +516,7 @@ uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream()
 
 // XDataSinkEncrSupport
 uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream()
-        throw ( packages::WrongPasswordException,
+        throw ( packages::WrongPasswordException, ZipException,
                 io::IOException,
                 RuntimeException, std::exception )
 {
commit e89358aeca3dcb224917e30a7bfbc74f9995480a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 23 09:57:52 2014 +0100

    coverity#706586 Uncaught exception
    
    Change-Id: I3ec05ae695428f92b7424295b6f2d3e833c6b162

diff --git a/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl b/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl
index e4c0de8..8814117 100644
--- a/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl
+++ b/offapi/com/sun/star/packages/XDataSinkEncrSupport.idl
@@ -121,11 +121,15 @@ interface XDataSinkEncrSupport: com::sun::star::uno::XInterface
     @returns
         the plain raw stream as it is stored in the package
 
+    @throws ::com::sun::star::packages::NoEncryptionException
+        the PackageStream object is not encrypted
+
     @throws ::com::sun::star::io::IOException
         in case of io problems during retrieving
      */
     ::com::sun::star::io::XInputStream getPlainRawStream()
-        raises( ::com::sun::star::io::IOException );
+        raises( ::com::sun::star::io::IOException,
+                ::com::sun::star::packages::NoEncryptionException );
 
 };
 
diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx
index cabc620..d8b686e 100644
--- a/package/inc/ZipPackageStream.hxx
+++ b/package/inc/ZipPackageStream.hxx
@@ -183,7 +183,7 @@ public:
                 ::com::sun::star::io::IOException,
                 ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getPlainRawStream()
-        throw ( ::com::sun::star::io::IOException,
+        throw ( ::com::sun::star::io::IOException, ::com::sun::star::packages::NoEncryptionException,
                 ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
 
     // XUnoTunnel
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index fee38a6..37710c0 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -653,7 +653,7 @@ void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputSt
 }
 
 uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getPlainRawStream()
-        throw ( io::IOException,
+        throw ( io::IOException, packages::NoEncryptionException,
                 uno::RuntimeException, std::exception )
 {
     // There is no stream attached to this object


More information about the Libreoffice-commits mailing list