[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Dec 17 07:07:42 PST 2010


 sw/source/core/swg/swblocks.cxx |  152 ----------------------------------------
 1 file changed, 152 deletions(-)

New commits:
commit 215f173a9edfc755ed9eec94c6a8cddfd84d4de5
Author: Anders Jonsson <anders.jonsson at norsjonet.se>
Date:   Thu Dec 16 20:31:58 2010 +0100

    Remove blocks of commented code

diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx
index c62555e..4de4ac0 100644
--- a/sw/source/core/swg/swblocks.cxx
+++ b/sw/source/core/swg/swblocks.cxx
@@ -261,8 +261,6 @@ SwTextBlocks::SwTextBlocks( const String& rFile )
     String sFileName = aObj.GetMainURL( INetURLObject::NO_DECODE );
     switch( SwImpBlocks::GetFileType( rFile ) )
     {
-    //case SWBLK_SW2:     pImp = new Sw2TextBlocks( sFileName );  break;
-    //case SWBLK_SW3:     pImp = new Sw3TextBlocks( sFileName );  break;
     case SWBLK_XML:		pImp = new SwXMLTextBlocks( sFileName ); break;
     case SWBLK_NO_FILE:	pImp = new SwXMLTextBlocks( sFileName ); break;
     }
@@ -300,156 +298,6 @@ BOOL SwTextBlocks::IsOld() const
 }
 
 
-/*
-ULONG SwTextBlocks::ConvertToNew()
-{
-    // Wir nehmen die aktuelle Datei, benennen diese in .BAK um
-    // und kreieren den neuen Storage
-    if( IsOld() )
-    {
-        // Erst mal muessen wir die Datei freigeben
-        short nType = pImp->GetFileType();
-        Sw2TextBlocks *pTwo = NULL;
-        Sw3TextBlocks *pThree = NULL;
-        SwImpBlocks *pOld = NULL;
-
-        pImp->nCur = (USHORT) -1;
-        String aName( pImp->aFile );
-        delete pImp; pImp = NULL;
-        // Jetzt wird umbenannt
-        INetURLObject aOldFull( aName );
-        INetURLObject aNewFull( aName );
-
-        aOldFull.SetExtension( String::CreateFromAscii("bak") );
-        String aOld( aOldFull.GetMainURL( INetURLObject::NO_DECODE ) );
-        String aNew( aNewFull.GetMainURL( INetURLObject::NO_DECODE ) );
-
-        BOOL bError = !SWUnoHelper::UCB_CopyFile( aNew, aOld, TRUE );
-        if( bError )
-        {
-            if (nType == SWBLK_SW2)
-                pImp = new Sw2TextBlocks( aOld );
-            else
-                pImp = new Sw3TextBlocks( aOld );
-            return nErr = ERR_SWG_CANNOT_WRITE;
-        }
-
-        // Die Datei ist erfolgreich umbenannt. Jetzt wird der Storage
-        // aufgesetzt
-        if (nType == SWBLK_SW2)
-            pOld = pTwo = new Sw2TextBlocks( aOld );
-        else
-            pOld = pThree = new Sw3TextBlocks( aOld );
-        SwXMLTextBlocks* pNew = new SwXMLTextBlocks( aName );
-        pNew->SetName ( pOld->GetName());
-        // Wir kopieren den Doc-Ptr in das alte System
-        // den alten SvPersist heben wir uns aber auf,
-        // da dieser die ganze Zeit leben bleibt
-        // und lesen die Dateivorlagen erneut ein
-        SvPersist* pPersist2 = pOld->pDoc->GetPersist();
-        if (SWBLK_SW2 == nType )
-        {
-            delete pOld->pDoc;
-            pOld->pDoc = pNew->pDoc;nLinkCt
-            nErr = pTwo->LoadDoc();
-        }
-        else
-        {
-            nErr = pThree->OpenFile ( TRUE );
-            // Within this call, Sw3IoImp::SetDoc calls RemoveLink
-            // on the old document, and deletes it if the
-            // ref count is now zero
-            pThree->SetDoc ( pNew->pDoc );
-            pOld->pDoc->AddLink();
-        }
-        if( !nErr && 0 == ( nErr = pNew->OpenFile( FALSE )) )
-        {
-            nErr = pNew->SetConvertMode( TRUE );
-            // jetzt werden die Bausteine einfach umkopiert!
-            if( !nErr )
-            {
-                if (SWBLK_SW2 == nType)
-                    pTwo->StatLineStartPercent();
-                USHORT nCount = pOld->GetCount();
-                for( USHORT i = 0; i < nCount; i++ )
-                {
-                    pNew->ClearDoc();
-                    String aShort( pOld->GetShortName( i ) );
-                    String aLong( pOld->GetLongName( i ) );
-                    pNew->AddName( aShort, aLong );
-                    if ( SWBLK_SW3 == nType && pThree->IsOnlyTextBlock(aShort) )
-                    {
-                        String sText;
-                        pThree->GetText( aShort, sText );
-                        pNew->PutText( aShort, aLong, sText );
-                    }
-                    else
-                    {
-                        if (SWBLK_SW2 == nType )
-                        {
-                            // I think this is how it should work (!!!!!!) mtg
-                            pNew->pDoc->SetPersist( pPersist2 );
-                        }
-                        nErr = pOld->GetDocForConversion( i );
-                        if( nErr )
-                            break;
-                        nErr = pNew->BeginPutDoc( aShort, aLong );
-                        if( nErr )
-                            break;
-                        nErr = pNew->PutDoc();
-                        if( nErr )
-                            break;
-                    }
-
-                    // convert macros, too
-                    SvxMacroTableDtor aMacroTable;
-                    pOld->GetMacroTable( i, aMacroTable, sal_True );
-                    pNew->SetMacroTable( i, aMacroTable, sal_True );
-
-                    if (SWBLK_SW2 == nType )
-                        pNew->pDoc->SetPersist( 0 );
-                }
-                if (SWBLK_SW2 == nType )
-                    ::EndProgress( pOld->pDoc->GetDocShell() );
-            }
-            if( !nErr )
-                nErr = pNew->SetConvertMode( FALSE );
-        }
-        if ( SWBLK_SW3 == nType )
-        {
-            pThree->CloseFile();
-        }
-        else
-        {
-            // Haben wir es geschafft?
-            pOld->pDoc = NULL;
-        }
-        pNew->ClearDoc();
-        if( !nErr )
-        {
-            delete pOld;
-            pImp = pNew;
-            SWUnoHelper::UCB_DeleteFile( aOld );
-            pNew->MakeBlockList();
-        }
-        else
-        {
-            delete pOld; delete pNew;
-            SWUnoHelper::UCB_DeleteFile( aNew );
-            SWUnoHelper::UCB_CopyFile( aOld, aNew, TRUE );
-            if ( SWBLK_SW2 == nType )
-                pImp = new Sw2TextBlocks( aOld );
-            else
-                pImp = new Sw3TextBlocks( aOld );
-        }
-        pNew->CloseFile();
-        FStatHelper::GetModifiedDateTimeOfFile( aNew,
-                            &pImp->aDateModified, &pImp->aTimeModified );
-    }
-    return nErr;
-} */
-
-
 USHORT SwTextBlocks::GetCount() const
 {
     return pImp ? pImp->GetCount() : 0;


More information about the Libreoffice-commits mailing list