delete comments in German and VIM at the beginning and end of file.
example:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset:
4 -*- *
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
************
files:
writer.cxx wrt_fn.cxx wrtswtbl.cxx
*path: build/clone/writer/sw/source/filter/writer*
My first patch: I hope everything goes well.
Regards and good luck to all
Luigi
--- ../../build/clone/writer/sw/source/filter/writer/writer.cxx 2010-10-28 22:12:01.454128322 +0200
+++ ../../build/clone/writer/sw/source/filter/writer/writerNEW.cxx 2010-10-29 17:22:26.778110535 +0200
@@ -1,8 +1,8 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,7 +50,7 @@
using namespace ::com::sun::star;
-// Stringbuffer fuer die umgewandelten Zahlen
+
static sal_Char aNToABuf[] = "0000000000000000000000000";
#define NTOABUFLEN (sizeof(aNToABuf))
@@ -130,18 +130,7 @@
}
}
-/*
- * Dieses Modul ist die Zentrale-Sammelstelle fuer alle Write-Filter
- * und ist eine DLL !
- *
- * Damit der Writer mit den unterschiedlichen Writern arbeiten kann,
- * muessen fuer diese die Ausgabe-Funktionen der Inhalts tragenden
- * Objecte auf die verschiedenen Ausgabe-Funktionen gemappt werden.
- *
- * Dazu kann fuer jedes Object ueber den Which-Wert in einen Tabelle ge-
- * griffen werden, um seine Ausgabe-Funktion zu erfragen.
- * Diese Funktionen stehen in den entsprechenden Writer-DLL's.
- */
+
Writer::Writer()
: m_pImpl(new Writer_Impl)
@@ -194,11 +183,11 @@
{
if( (*ppPam)->GetNext() == pOrigPam )
{
- *ppPam = pOrigPam; // wieder auf den Anfangs-Pam setzen
- return FALSE; // Ende vom Ring
+ *ppPam = pOrigPam;
+ return FALSE;
}
- // ansonsten kopiere den die Werte aus dem naechsten Pam
+
*ppPam = ((SwPaM*)(*ppPam)->GetNext() );
*pCurPam->GetPoint() = *(*ppPam)->Start();
@@ -207,7 +196,7 @@
return TRUE;
}
-// suche die naechste Bookmark-Position aus der Bookmark-Tabelle
+
sal_Int32 Writer::FindPos_Bkmk(const SwPosition& rPos) const
{
@@ -250,7 +239,7 @@
/////////////////////////////////////////////////////////////////////////////
-// Stream-spezifisches
+
SvStream& Writer::Strm()
{
ASSERT( m_pImpl->m_pStream, "Oh-oh. Writer with no Stream!" );
@@ -262,8 +251,8 @@
SvStream& Writer::OutHex( SvStream& rStrm, ULONG nHex, BYTE nLen )
-{ // in einen Stream aus
- // Pointer an das Bufferende setzen
+{
+
sal_Char* pStr = aNToABuf + (NTOABUFLEN-1);
for( BYTE n = 0; n < nLen; ++n )
{
@@ -277,7 +266,7 @@
SvStream& Writer::OutLong( SvStream& rStrm, long nVal )
{
- // Pointer an das Bufferende setzen
+
sal_Char* pStr = aNToABuf + (NTOABUFLEN-1);
int bNeg = nVal < 0;
@@ -289,7 +278,7 @@
nVal /= 10;
} while( nVal );
- // Ist Zahl negativ, dann noch -
+
if( bNeg )
*(--pStr) = '-';
@@ -298,7 +287,7 @@
SvStream& Writer::OutULong( SvStream& rStrm, ULONG nVal )
{
- // Pointer an das Bufferende setzen
+
sal_Char* pStr = aNToABuf + (NTOABUFLEN-1);
do {
@@ -324,9 +313,9 @@
pOrigFileName = pFName;
m_pImpl->m_pStream = &rStrm;
- // PaM kopieren, damit er veraendert werden kann
+
pCurPam = new SwPaM( *rPaM.End(), *rPaM.Start() );
- // zum Vergleich auf den akt. Pam sichern
+
pOrigPam = &rPaM;
ULONG nRet = WriteStream();
@@ -375,7 +364,7 @@
if (m_pImpl->pSrcArr)
{
- // wurde die Datei schon verschoben
+
USHORT nPos;
if (m_pImpl->pSrcArr->Seek_Entry( &rFileNm, &nPos ))
{
@@ -420,9 +409,7 @@
void Writer::PutNumFmtFontsInAttrPool()
{
- // dann gibt es noch in den NumRules ein paar Fonts
- // Diese in den Pool putten. Haben sie danach einen RefCount > 1
- // kann es wieder entfernt werden - ist schon im Pool
+
SfxItemPool& rPool = pDoc->GetAttrPool();
const SwNumRuleTbl& rListTbl = pDoc->GetNumRuleTbl();
const SwNumRule* pRule;
@@ -577,7 +564,7 @@
////////////////////////////////////////////////////////////////////////////
-// Storage-spezifisches
+
ULONG StgWriter::WriteStream()
{
@@ -592,9 +579,9 @@
pDoc = rPaM.GetDoc();
pOrigFileName = pFName;
- // PaM kopieren, damit er veraendert werden kann
+
pCurPam = new SwPaM( *rPaM.End(), *rPaM.Start() );
- // zum Vergleich auf den akt. Pam sichern
+
pOrigPam = &rPaM;
ULONG nRet = WriteStorage();
@@ -613,9 +600,9 @@
pDoc = rPaM.GetDoc();
pOrigFileName = pFName;
- // PaM kopieren, damit er veraendert werden kann
+
pCurPam = new SwPaM( *rPaM.End(), *rPaM.Start() );
- // zum Vergleich auf den akt. Pam sichern
+
pOrigPam = &rPaM;
ULONG nRet = pMedium ? WriteMedium( *pMedium ) : WriteStorage();
@@ -626,4 +613,4 @@
return nRet;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
--- wrt_fn.cxx 2010-10-28 22:12:01.454128322 +0200
+++ wrt_fnNEW.cxx 2010-10-29 17:31:03.426612503 +0200
@@ -1,8 +1,8 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -54,10 +54,10 @@
const SfxItemSet& rSet, BOOL bDeep,
BOOL bTstForDefault )
{
- // erst die eigenen Attribute ausgeben
+
const SfxItemPool& rPool = *rSet.GetPool();
const SfxItemSet* pSet = &rSet;
- if( !pSet->Count() ) // Optimierung - leere Sets
+ if( !pSet->Count() )
{
if( !bDeep )
return rWrt;
@@ -101,7 +101,7 @@
Writer& Out( const SwNodeFnTab pTab, SwNode& rNode, Writer & rWrt )
{
- // es muss ein CntntNode sein !!
+
SwCntntNode * pCNd = rNode.GetCntntNode();
if( !pCNd )
return rWrt;
@@ -129,4 +129,4 @@
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
--- wrtswtbl.cxx 2010-10-28 22:12:01.458127734 +0200
+++ wrtswtblNEW.cxx 2010-10-29 17:38:12.382110506 +0200
@@ -1,8 +1,8 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -120,13 +120,13 @@
long nHeight = 0;
if( bUseLayoutHeights )
{
- // Erstmal versuchen wir die Hoehe ueber das Layout zu bekommen
+
bool bLayoutAvailable = false;
nHeight = pLine->GetTableLineHeight(bLayoutAvailable);
if( nHeight > 0 )
return nHeight;
- // Wenn kein Layout gefunden wurde, gehen wir von festen Hoehen aus.
+
// --> FME 2007-3-26 #i60390# in some cases we still want to continue
// to use the layout heights even if one of the rows has a height of 0
// ('hidden' rows)
@@ -320,7 +320,7 @@
{
USHORT nSpace = nCellPadding + nCellSpacing;
- // In der ersten Spalte auch noch die Liniendicke abziehen
+
if( nCol==0 )
{
nSpace = nSpace + nLeftSub;
@@ -337,8 +337,7 @@
{
USHORT nSpace = nCellPadding;
- // In der letzten Spalte noch einmal zusaetzlich CELLSPACING und
- // und die Liniendicke abziehen
+
if( nCol+nColSpan==aCols.Count() )
{
nSpace += (nCellSpacing + nRightSub);
@@ -378,7 +377,7 @@
{
long nWidth = GetRawWidth( nCol, nColSpan );
- // sieht komisch aus, ist aber nichts anderes als
+
// [(100 * nWidth) + .5] ohne Rundungsfehler
return (USHORT)(long)Fraction( nWidth*100 + GetBaseWidth()/2,
GetBaseWidth() );
@@ -389,8 +388,7 @@
{
nRawHeight -= (2*nCellPadding + nCellSpacing);
- // In der ersten Zeile noch einmal zusaetzlich CELLSPACING und
- // und die Liniendicke abziehen
+
const SwWriteTableRow *pRow = 0;
if( nRow==0 )
{
@@ -400,7 +398,7 @@
nRawHeight -= nBorder;
}
- // In der letzten Zeile noch die Liniendicke abziehen
+
if( nRow+nRowSpan==aRows.Count() )
{
if( !pRow || nRowSpan > 1 )
@@ -481,7 +479,7 @@
#endif
}
- // Fuer alle Boxen der Zeile ggf. eine Spalte einfuegen
+
const SwTableBoxes& rBoxes = pLine->GetTabBoxes();
USHORT nBoxes = rBoxes.Count();
@@ -570,7 +568,7 @@
{
const SwTableLine *pLine = rLines[nLine];
- // Position der letzten ueberdeckten Zeile ermitteln
+
long nOldRPos = nRPos;
if( nLine < nLines-1 || nParentLineHeight==0 )
{
@@ -589,7 +587,7 @@
else
nRPos = nStartRPos + nParentLineHeight;
- // Und ihren Index
+
USHORT nOldRow = nRow;
SwWriteTableRow aRow( nRPos,bUseLayoutHeights );
#ifdef DBG_UTIL
@@ -630,9 +628,7 @@
{
pLineBrush = (const SvxBrushItem *)pItem;
- // Wenn die Zeile die gesamte Tabelle umspannt, koennen
- // Wir den Hintergrund an der Zeile ausgeben. Sonst muessen
- // wir in an den Zelle ausgeben.
+
BOOL bOutAtRow = !nParentLineWidth;
if( !bOutAtRow && nStartCPos==0 )
{
@@ -663,7 +659,7 @@
{
const SwTableBox *pBox = rBoxes[nBox];
- // Position der letzten ueberdeckten Spalte ermitteln
+
USHORT nOldCPos = nCPos;
if( nBox < nBoxes-1 || (nParentLineWidth==0 && nLine==0) )
{
@@ -674,7 +670,7 @@
else
nCPos = nStartCPos + nParentLineWidth;
- // Und ihren Index
+
USHORT nOldCol = nCol;
SwWriteTableCol aCol( nCPos );
#ifdef DBG_UTIL
@@ -698,7 +694,7 @@
pRow->AddCell( pBox, nOldRow, nOldCol,
nRowSpan, nColSpan, nHeight,
pBrushItem );
- nHeight = 0; // Die Hoehe braucht nur einmal geschieben werden
+ nHeight = 0;
if( pBox->GetSttNd() )
{
@@ -761,7 +757,7 @@
bSubExpanded = TRUE;
}
- nCol++; // Die naechste Zelle faengt in der nachten Spalte an
+ nCol++;
}
nRow++;
@@ -782,16 +778,15 @@
{
USHORT nParentWidth = nBaseWidth + nLeftSub + nRightSub;
- // Erstmal die Tabellen-Struktur festlegen. Hinter der Tabelle ist in
- // jedem Fall eine Spalte zu Ende
+
SwWriteTableCol *pCol = new SwWriteTableCol( nParentWidth );
aCols.Insert( pCol );
CollectTableRowsCols( 0, 0, 0, nParentWidth, rLines, nMaxDepth - 1 );
- // Und jetzt mit leben fuellen
+
FillTableRowsCols( 0, 0, 0, 0, 0, nParentWidth, rLines, 0, nMaxDepth - 1, static_cast< sal_uInt16 >(nNumOfRowsToRepeat) );
- // Einige Twip-Werte an Pixel-Grenzen anpassen
+
if( !nBorder )
nBorder = nInnerBorder;
}
@@ -819,7 +814,7 @@
USHORT nCols = pLayoutInfo->GetColCount();
USHORT nRows = pLayoutInfo->GetRowCount();
- // Erstmal die Tabellen-Struktur festlegen.
+
for( nCol=0; nCol<nCols; nCol++ )
{
SwWriteTableCol *pCol =
@@ -845,7 +840,7 @@
aRows.Insert( pRow );
}
- // Und jetzt mit leben fuellen
+
for( nRow=0; nRow<nRows; nRow++ )
{
SwWriteTableRow *pRow = aRows[nRow];
@@ -859,8 +854,7 @@
const SwHTMLTableLayoutCnts *pLayoutCnts =
pLayoutCell->GetContents();
- // Beginnt die Zelle eigentlich eine Zeile weiter oben oder
- // weiter vorne?
+
if( ( nRow>0 && pLayoutCnts == pLayoutInfo->GetCell(nRow-1,nCol)
->GetContents() ) ||
( nCol>0 && pLayoutCnts == pLayoutInfo->GetCell(nRow,nCol-1)
@@ -904,13 +898,13 @@
if( !(nBorderMask & 2) )
pEndRow->bBottomBorder = FALSE;
- // Die Hoehe braucht nur einmal geschieben werden
+
if( nHeight )
bHeightExported = TRUE;
}
}
- // Einige Twip-Werte an Pixel-Grenzen anpassen
+
if( bCollectBorderWidth && !nBorder )
nBorder = nInnerBorder;
}
@@ -919,4 +913,4 @@
{
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice