Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3294
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/94/3294/1
Translate German comments and general clean-up
Removed some whitespace, programmer handles in comments and
commented out code.
Change-Id: I68a1285355b14e122f218b2f483ebc74a2b2dbaf
---
M vcl/source/gdi/outdev3.cxx
M vcl/source/gdi/print.cxx
2 files changed, 113 insertions(+), 197 deletions(-)
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index e47acb0..1c5f819 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -279,7 +279,7 @@
{
if ( pFrame->ImplGetGraphics() )
{
- // MT: Stupid typecast here and somewhere ((OutputDevice*)&aVDev)->, because bug
in .NET2002 compiler.
+ // Stupid typecast here and somewhere ((OutputDevice*)&aVDev)->, because bug in
.NET2002 compiler
OutputDevice *pDevice = (OutputDevice*)pFrame;
pDevice->mpGraphics->ClearDevFontCache();
pDevice->mpGraphics->GetDevFontList(pFrame->mpWindowImpl->mpFrameData->mpFontList);
@@ -483,7 +483,7 @@
case DEFAULTFONT_CJK_SPREADSHEET:
case DEFAULTFONT_CJK_HEADING:
case DEFAULTFONT_CJK_DISPLAY:
- aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config
later...
+ aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config
later...
break;
case DEFAULTFONT_CTL_TEXT:
@@ -491,7 +491,7 @@
case DEFAULTFONT_CTL_SPREADSHEET:
case DEFAULTFONT_CTL_HEADING:
case DEFAULTFONT_CTL_DISPLAY:
- aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config
later...
+ aFont.SetFamily( FAMILY_SYSTEM ); // don't care, but don't use font subst config
later...
break;
}
@@ -1026,7 +1026,7 @@
// TODO: is it cheaper to calc matching attributes now or on demand?
// calc matching attributes if other entries are already initialized
- // MT: Perform05: Do lazy, quite expensive, not needed in start-up!
+ // Do lazy, quite expensive, not needed in start-up!
// const FontSubstConfiguration& rFontSubst = *FontSubstConfiguration::get();
// InitMatchData( rFontSubst, maSearchName );
// mbMatchData=true; // Somewhere else???
@@ -1101,7 +1101,7 @@
&& rSearchName.Equals( maSearchName, 0, maSearchName.Len() ) )
pTargetStyleName = rSearchName.GetBuffer() + maSearchName.Len() + 1;
- // linear search, TODO: improve?
+ // TODO: linear search improve!
PhysicalFontFace* pFontFace = mpFirst;
PhysicalFontFace* pBestFontFace = pFontFace;
FontMatchStatus aFontMatchStatus = {0,0,0, pTargetStyleName};
@@ -1228,7 +1228,7 @@
for( const char** ppNames = &aGlyphFallbackList[0];; ++ppNames )
{
// advance to next sub-list when end-of-sublist marker
- if( !**ppNames ) // #i46456# check for empty string, i.e., deref string itself not only
ptr to it
+ if( !**ppNames ) // #i46456# check for empty string, i.e., deref string itself not only
ptr to it
{
if( nBestQuality > 0 )
if( ++nMaxLevel >= MAX_FALLBACK )
@@ -1330,11 +1330,11 @@
else
rFontSelData.maSearchName = OUString();
- //See fdo#32665 for an example. FreeSerif that has glyphs in normal
- //font, but not in the italic or bold version
+ // See fdo#32665 for an example. FreeSerif that has glyphs in normal
+ // font, but not in the italic or bold version
bool bSubSetOfFontRequiresPropertyFaking = rFontSelData.mbEmbolden ||
rFontSelData.maItalicMatrix != ItalicMatrix();
- // cache the result even if there was no match, unless its from part of a font for
which the properties need
+ // Cache the result even if there was no match, unless its from part of a font for
which the properties need
// to be faked. We need to rework this cache to take into account that fontconfig can
return different fonts
// for different input sizes, weights, etc. Basically the cache is way to naive
if (!bSubSetOfFontRequiresPropertyFaking)
@@ -1455,7 +1455,7 @@
ImplDevFontListData* ImplDevFontList::FindFontFamily( const String& rFontName ) const
{
- // normalize the font fomily name and
+ // normalize the font family name and
OUString aName = rFontName;
GetEnglishSearchFontName( aName );
ImplDevFontListData* pFound = ImplFindBySearchName( aName );
@@ -1736,7 +1736,7 @@
nTestMatch -= 1000000;
// test font name substrings
- // TODO: calculate name matching score using e.g. Levenstein distance
+ // TODO: calculate name matching score using e.g. Levenstein distance
if( (rSearchFamilyName.getLength() >= 4) && (pData->maMatchFamilyName.Len() >= 4)
&& ((rSearchFamilyName.indexOf( pData->maMatchFamilyName ) != -1)
|| (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) )
@@ -1945,7 +1945,6 @@
ImplDevFontList* ImplDevFontList::Clone( bool bScalable, bool bEmbeddable ) const
{
ImplDevFontList* pClonedList = new ImplDevFontList;
-// pClonedList->mbMatchData = mbMatchData;
pClonedList->mbMapNames = mbMapNames;
pClonedList->mpPreMatchHook = mpPreMatchHook;
pClonedList->mpFallbackHook = mpFallbackHook;
@@ -2156,7 +2155,7 @@
// check font face attributes
if( (rA.GetWeight() != rB.GetWeight())
|| (rA.GetSlant() != rB.GetSlant())
-// || (rA.meFamily != rB.meFamily) // TODO: remove this mostly obsolete member
+// || (rA.meFamily != rB.meFamily) // TODO: remove this mostly obsolete member
|| (rA.GetPitch() != rB.GetPitch()) )
return false;
@@ -2318,8 +2317,8 @@
{
OUString stripCharSetFromName(OUString aName)
{
- //I worry that someone will have a font which *does* have
- //e.g. "Greek" legitimately at the end of its name :-(
+ // I worry that someone will have a font which *does* have
+ // e.g. "Greek" legitimately at the end of its name :-(
const char*suffixes[] =
{
" baltic",
@@ -2333,7 +2332,7 @@
" (vietnamese)"
};
- //These can be crazily piled up, e.g. Times New Roman CYR Greek
+ // These can be crazily piled up, e.g. Times New Roman CYR Greek
bool bFinished = false;
while (!bFinished)
{
@@ -2435,10 +2434,10 @@
rFSD.maTargetName = aBaseFontName;
#endif
- //Related: fdo#49271 RTF files often contain weird-ass
- //Win 3.1/Win95 style fontnames which attempt to put the
- //charset encoding into the filename
- //http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm
+ // Related: fdo#49271 RTF files often contain weird-ass
+ // Win 3.1/Win95 style fontnames which attempt to put the
+ // charset encoding into the filename
+ // http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm
OUString sStrippedName = stripCharSetFromName(rFSD.maTargetName);
if (!sStrippedName.equals(rFSD.maTargetName))
{
@@ -2513,7 +2512,6 @@
eSearchWeight, eSearchWidth, nSearchType );
// note: the search name was already translated to english (if possible)
-
// use the font's shortened name if needed
if ( aSearchShortName != aSearchName )
{
@@ -2595,7 +2593,6 @@
}
// use a font name from font fallback list to determine font attributes
-
// get fallback info using FontSubstConfiguration and
// the target name, it's shortened name and family name in that order
const FontSubstConfiguration& rFontSubst = FontSubstConfiguration::get();
@@ -3449,7 +3446,7 @@
long nStartX = nBaseX + nDistX;
long nStartY = nBaseY + nDistY;
- // Bei Hoehe von 1 Pixel reicht es, eine Linie auszugeben
+ // If the height is 1 pixel, it's enough ouput a line
if ( (nLineWidth == 1) && (nHeight == 1) )
{
mpGraphics->SetLineColor( ImplColorToSal( rColor ) );
@@ -3477,7 +3474,7 @@
long nPixWidth;
long nPixHeight;
sal_Bool bDrawPixAsRect;
- // Auf Druckern die Pixel per DrawRect() ausgeben
+ // On printers that ouput pixel via DrawRect()
if ( (GetOutDevType() == OUTDEV_PRINTER) || (nLineWidth > 1) )
{
if ( mbLineColor || mbInitLineColor )
@@ -3759,9 +3756,8 @@
}
nDashWidth = ((nDashWidth*mnDPIX)+1270)/2540;
nSpaceWidth = ((nSpaceWidth*mnDPIX)+1270)/2540;
- // DashWidth wird gegebenenfalls verbreitert, wenn
- // die dicke der Linie im Verhaeltnis zur Laenge
- // zu dick wird
+ // DashWidth will be increased if the line is getting too thick
+ // in proportion to the line's length
if ( nDashWidth < nMinDashWidth )
nDashWidth = nMinDashWidth;
if ( nSpaceWidth < nMinSpaceWidth )
@@ -3785,9 +3781,8 @@
nDotWidth /= mnDPIY;
long nDashWidth = ((100*mnDPIX)+1270)/2540;
long nMinDashWidth = nDotWidth*4;
- // DashWidth wird gegebenenfalls verbreitert, wenn
- // die dicke der Linie im Verhaeltnis zur Laenge
- // zu dick wird
+ // DashWidth will be increased if the line is getting too thick
+ // in proportion to the line's length
if ( nDashWidth < nMinDashWidth )
nDashWidth = nMinDashWidth;
long nTempDotWidth = nDotWidth;
@@ -3816,9 +3811,8 @@
nDotWidth /= mnDPIY;
long nDashWidth = ((100*mnDPIX)+1270)/2540;
long nMinDashWidth = nDotWidth*4;
- // DashWidth wird gegebenenfalls verbreitert, wenn
- // die dicke der Linie im Verhaeltnis zur Laenge
- // zu dick wird
+ // DashWidth will be increased if the line is getting too thick
+ // in proportion to the line's length
if ( nDashWidth < nMinDashWidth )
nDashWidth = nMinDashWidth;
long nTempDotWidth = nDotWidth;
@@ -3918,8 +3912,8 @@
FontStrikeout eStrikeout,
Color aColor )
{
- //See qadevOOo/testdocs/StrikeThrough.odt for examples if you need
- //to tweak this
+ // See qadevOOo/testdocs/StrikeThrough.odt for examples if you need
+ // to tweak this
if (!nWidth)
return;
@@ -4080,8 +4074,9 @@
if( bWordLine )
{
// draw everything relative to the layout base point
- const Point aStartPt = rSalLayout.DrawBase();
- // calculate distance of each word from the base point
+ const Point aStartPt = rSalLayout.DrawBase();
+
+ // calculate distance of each word from the base point
Point aPos;
sal_Int32 nDist = 0, nWidth = 0, nAdvance=0;
for( int nStart = 0;;)
@@ -4111,7 +4106,7 @@
}
else if( nWidth > 0 )
{
- // draw the textline for each word
+ // draw the textline for each word
ImplDrawTextLine( aStartPt.X(), aStartPt.Y(), nDist, nWidth,
eStrikeout, eUnderline, eOverline, bUnderlineAbove );
nWidth = 0;
@@ -4212,7 +4207,7 @@
Polygon aPoly( Point( nRad, nRad ), nRad, nRad );
rPolyPoly.Insert( aPoly );
}
- rYOff = ((nHeight*250)/1000)/2; // Center to the anthoer EmphasisMarks
+ rYOff = ((nHeight*250)/1000)/2; // Center to the another EmphasisMarks
rWidth = nDotSize;
break;
@@ -4524,9 +4519,8 @@
}
else if( IsRTLEnabled() )
{
- //long w = meOutDevType == OUTDEV_VIRDEV ? mnOutWidth : mpGraphics->GetGraphicsWidth();
- //long x = rSalLayout.DrawBase().X();
OutputDevice *pOutDevRef = (OutputDevice *)this;
+
// mirror this window back
long devX = pOutDevRef->mnOutOffX; // re-mirrored mnOutOffX
rSalLayout.DrawBase().X() = pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() -
devX) + devX;
@@ -4730,25 +4724,24 @@
const com::sun::star::lang::Locale&
rDefLocale(Application::GetSettings().GetUILanguageTag().getLocale());
xub_StrLen nSoftBreak = _rLayout.GetTextBreak( rStr, nWidth, nPos, nBreakPos -
nPos );
DBG_ASSERT( nSoftBreak < nBreakPos, "Break?!" );
- //aHyphOptions.hyphenIndex = nSoftBreak;
i18n::LineBreakResults aLBR = xBI->getLineBreak( aText, nSoftBreak,
rDefLocale, nPos, aHyphOptions, aUserOptions );
nBreakPos = (xub_StrLen)aLBR.breakIndex;
if ( nBreakPos <= nPos )
nBreakPos = nSoftBreak;
if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) ==
TEXT_DRAW_WORDBREAK_HYPHENATION )
{
- // Egal ob Trenner oder nicht: Das Wort nach dem Trenner durch
- // die Silbentrennung jagen...
- // nMaxBreakPos ist das letzte Zeichen was in die Zeile passt,
- // nBreakPos ist der Wort-Anfang
- // Ein Problem gibt es, wenn das Dok so schmal ist, dass ein Wort
- // auf mehr als Zwei Zeilen gebrochen wird...
+ // Whether hyphen or not: Put the word after the hyphen through
+ // word boundary.
+ //
+ // nMaxBreakPos the last char that fits into the line
+ // nBreakPos is the word's start
+ //
+ // We run into a problem if the doc is so narrow, that a word
+ // is broken into more than two lines ...
if ( xHyph.is() )
{
sal_Unicode cAlternateReplChar = 0;
i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos,
rDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True );
- // sal_uInt16 nWordStart = nBreakPos;
- // sal_uInt16 nBreakPos_OLD = nBreakPos;
sal_Int32 nWordStart = nPos;
sal_Int32 nWordEnd = (sal_Int32) aBoundary.endPos;
DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" );
@@ -4759,7 +4752,7 @@
// #104415# May happen, because getLineBreak may differ from
getWordBoudary with DICTIONARY_WORD
// DBG_ASSERT( nWordEnd >= nMaxBreakPos, "Hyph: Break?" );
String aWord( aText, nWordStart, nWordLen );
- sal_uInt16 nMinTrail =
static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Vor dem angeknacksten Buchstaben
+ sal_uInt16 nMinTrail =
static_cast<sal_uInt16>(nWordEnd-nSoftBreak+1); //+1: Before the "broken off" char
uno::Reference< linguistic2::XHyphenatedWord > xHyphWord;
if (xHyph.is())
xHyphWord = xHyph->hyphenate( aWord, rDefLocale, aWord.Len() -
nMinTrail, uno::Sequence< beans::PropertyValue >() );
@@ -4778,27 +4771,27 @@
{
String aAlt( xHyphWord->getHyphenatedWord() );
- // Wir gehen von zwei Faellen aus, die nun
- // vorliegen koennen:
- // 1) packen wird zu pak-ken
- // 2) Schiffahrt wird zu Schiff-fahrt
- // In Fall 1 muss ein Zeichen ersetzt werden,
- // in Fall 2 wird ein Zeichen hinzugefuegt.
- // Die Identifikation wird erschwert durch Worte wie
- // "Schiffahrtsbrennesseln", da der Hyphenator alle
- // Position des Wortes auftrennt und
"Schifffahrtsbrennnesseln"
- // ermittelt. Wir koennen also eigentlich nicht
unmittelbar vom
- // Index des AlternativWord auf aWord schliessen.
-
- // Das ganze geraffel wird durch eine Funktion am
- // Hyphenator vereinfacht werden, sobald AMA sie
einbaut...
+ // We can have two cases:
+ // 1) "packen" turns into "pak-ken"
+ // 2) "Schiffahrt" turns into "Schiff-fahrt"
+ //
+ // In case 1 we need to replace a char
+ // In case 2 we add a char
+ //
+ // Correct recognition is made harder by words such as
+ // "Schiffahrtsbrennesseln", as the Hyphenator splits
all
+ // positions of the word and comes up with
"Schifffahrtsbrennnesseln"
+ // Thus, we cannot infer the aWord from the
AlternativWord's
+ // index.
+ // TODO: The whole junk will be made easier by a
function in
+ // the Hyphenator, as soon as AMA adds it.
sal_uInt16 nAltStart = _nWordLen - 1;
sal_uInt16 nTxtStart = nAltStart - (aAlt.Len() -
aWord.Len());
sal_uInt16 nTxtEnd = nTxtStart;
sal_uInt16 nAltEnd = nAltStart;
- // Die Bereiche zwischen den nStart und nEnd ist
- // die Differenz zwischen Alternativ- und
OriginalString.
+ // The area between nStart and nEnd is the difference
+ // between AlternativString and OriginalString
while( nTxtEnd < aWord.Len() && nAltEnd < aAlt.Len() &&
aWord.GetChar(nTxtEnd) != aAlt.GetChar(nAltEnd)
)
{
@@ -4806,7 +4799,7 @@
++nAltEnd;
}
- // Wenn ein Zeichen hinzugekommen ist, dann bemerken
wir es jetzt:
+ // If a char was added, we notice it now:
if( nAltEnd > nTxtEnd && nAltStart == nAltEnd &&
aWord.GetChar( nTxtEnd ) == aAlt.GetChar(nAltEnd) )
{
@@ -4815,7 +4808,7 @@
++nTxtEnd;
}
- DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate:
Falsche Annahme!" );
+ DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate:
Wrong assumption!" );
if ( nTxtEnd > nTxtStart )
cAlternateReplChar = aAlt.GetChar( nAltStart );
@@ -4824,10 +4817,10 @@
if ( cAlternateReplChar )
nBreakPos++;
}
- } // if (xHyphWord.is())
- } // if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
- } // if ( xHyph.is() )
- } // if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) ==
TEXT_DRAW_WORDBREAK_HYPHENATION )
+ }
+ }
+ }
+ }
}
nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
}
@@ -5638,7 +5631,7 @@
// if requested move caret position to cell limits
if( bCellBreaking )
{
- ; // TODO
+ ; // FIXME
}
return true;
@@ -5760,7 +5753,6 @@
bRightAlign = true;
// SSA: hack for western office, ie text get right aligned
// for debugging purposes of mirrored UI
- //static const char* pEnv = getenv( "SAL_RTL_MIRRORTEXT" );
bool bRTLWindow = IsRTLEnabled();
bRightAlign ^= bRTLWindow;
if( bRightAlign )
@@ -5922,8 +5914,8 @@
pFallback->AdjustLayout( rLayoutArgs );
- //All we care about here is getting the vertical bounds of this text and
- //make sure it will fit inside the available space
+ // All we care about here is getting the vertical bounds of this text and
+ // make sure it will fit inside the available space
Point aPos;
for( int nStart = 0;;)
{
@@ -5944,7 +5936,7 @@
}
}
- //Shrink it down if it won't fit
+ // Shrink it down if it won't fit
if (bHaveBounding)
{
long nGlyphsAscent = -aBoundRect.Top();
@@ -6208,12 +6200,6 @@
{
// draw disabled text always without shadow
// as it fits better with native look
- /*
- SetTextColor( GetSettings().GetStyleSettings().GetLightColor() );
- Rectangle aRect = rRect;
- aRect.Move( 1, 1 );
- DrawText( aRect, rOrigStr, nStyle & ~TEXT_DRAW_DISABLE );
- */
rTargetDevice.SetTextColor(
rTargetDevice.GetSettings().GetStyleSettings().GetDisableColor() );
}
}
@@ -6236,7 +6222,7 @@
const bool bDrawMnemonics = !(rTargetDevice.GetSettings().GetStyleSettings().GetOptions() &
STYLE_OPTION_NOMNEMONICS) && !pVector;
- // Mehrzeiligen Text behandeln wir anders
+ // We treat multiline text differently
if ( nStyle & TEXT_DRAW_MULTILINE )
{
@@ -6258,12 +6244,12 @@
{
if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
{
- // Letzte Zeile zusammenbauen und kuerzen
+ // Create last line and shorten it
nFormatLines = nLines-1;
pLineInfo = aMultiLineInfo.GetLine( nFormatLines );
aLastLine = convertLineEnd(aStr.Copy(pLineInfo->GetIndex()), LINEEND_LF);
- // Alle LineFeed's durch Spaces ersetzen
+ // Replace all LineFeeds with Spaces
xub_StrLen nLastLineLen = aLastLine.Len();
for ( i = 0; i < nLastLineLen; i++ )
{
@@ -6281,30 +6267,30 @@
nStyle &= ~TEXT_DRAW_CLIP;
}
- // Muss in der Hoehe geclippt werden?
+ // Do we need to clip the height?
if ( nFormatLines*nTextHeight > nHeight )
nStyle |= TEXT_DRAW_CLIP;
- // Clipping setzen
+ // Set clipping
if ( nStyle & TEXT_DRAW_CLIP )
{
rTargetDevice.Push( PUSH_CLIPREGION );
rTargetDevice.IntersectClipRegion( rRect );
}
- // Vertikales Alignment
+ // Vertical alignment
if ( nStyle & TEXT_DRAW_BOTTOM )
aPos.Y() += nHeight-(nFormatLines*nTextHeight);
else if ( nStyle & TEXT_DRAW_VCENTER )
aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2;
- // Font Alignment
+ // Font alignment
if ( eAlign == ALIGN_BOTTOM )
aPos.Y() += nTextHeight;
else if ( eAlign == ALIGN_BASELINE )
aPos.Y() += rTargetDevice.GetFontMetric().GetAscent();
- // Alle Zeilen ausgeben, bis auf die letzte
+ // Output all lines except for the last one
for ( i = 0; i < nFormatLines; i++ )
{
pLineInfo = aMultiLineInfo.GetLine( i );
@@ -6341,12 +6327,11 @@
}
- // Gibt es noch eine letzte Zeile, dann diese linksbuendig ausgeben,
- // da die Zeile gekuerzt wurde
+ // If there still is a last line, we output it left-aligned as the line would be
clipped
if ( aLastLine.Len() )
_rLayout.DrawText( aPos, aLastLine, 0, STRING_LEN, pVector, pDisplayText );
- // Clipping zuruecksetzen
+ // Reset clipping
if ( nStyle & TEXT_DRAW_CLIP )
rTargetDevice.Pop();
}
@@ -6355,7 +6340,7 @@
{
long nTextWidth = _rLayout.GetTextWidth( aStr, 0, -1 );
- // Evt. Text kuerzen
+ // Clip text if needed
if ( nTextWidth > nWidth )
{
if ( nStyle & TEXT_DRAW_ELLIPSIS )
@@ -6389,9 +6374,9 @@
else if ( nStyle & TEXT_DRAW_VCENTER )
aPos.Y() += (nHeight-nTextHeight)/2;
- long nMnemonicX = 0;
- long nMnemonicY = 0;
- long nMnemonicWidth = 0;
+ long nMnemonicX = 0;
+ long nMnemonicY = 0;
+ long nMnemonicWidth = 0;
if ( nMnemonicPos != STRING_NOTFOUND )
{
sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.Len() );
@@ -6720,7 +6705,7 @@
else if ( nStyle & TEXT_DRAW_NEWSELLIPSIS )
{
static sal_Char const pSepChars[] = ".";
- // Letztes Teilstueck ermitteln
+ // Determine last section
sal_Int32 nLastContent = aStr.getLength();
while ( nLastContent )
{
@@ -6749,7 +6734,7 @@
while ( (nFirstContent < nLastContent) &&
ImplIsCharIn( aStr[ nFirstContent ], pSepChars ) )
nFirstContent++;
- //MEM continue here
+ // MEM continue here
if ( nFirstContent >= nLastContent )
aStr = OutputDevice::ImplGetEllipsisString( rTargetDevice, aStr, nMaxWidth,
nStyle | TEXT_DRAW_ENDELLIPSIS, _rLayout );
else
@@ -6847,7 +6832,7 @@
// #106952#
// may occur in BiDi-Strings: the '~' is sometimes found behind the last char
// due to some strange BiDi text editors
- // ->place the underline behind the string to indicate a failure
+ // -> place the underline behind the string to indicate a failure
bInvalidPos = sal_True;
nMnemonicPos = nLen-1;
}
@@ -7561,11 +7546,9 @@
if( bRet || (OUTDEV_PRINTER == meOutDevType) || !mpFontEntry )
return bRet;
- // fall back to bitmap conversion ------------------------------------------
-
+ // fall back to bitmap conversion
// Here, we can savely assume that the mapping between characters and glyphs
// is one-to-one. This is most probably valid for the old bitmap fonts.
-
// fall back to bitmap method to get the bounding rectangle,
// so we need a monochrome virtual device with matching font
pSalLayout = ImplLayout( rStr, nIndex, nLen, Point(0,0), nTWidth, pDXArray );
@@ -7626,8 +7609,8 @@
bRet = true;
bool bRTL = false;
OUString aStr( rStr ); // prepare for e.g. localized digits
- sal_Int32 nIndex2 = nIndex; // only needed until nIndex is sal_Int32
- sal_Int32 nLen2 = nLen; // only needed until nLen is sal_Int32
+ sal_Int32 nIndex2 = nIndex; // only needed until nIndex is sal_Int32
+ sal_Int32 nLen2 = nLen; // only needed until nLen is sal_Int32
ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nIndex2, nLen2, 0, NULL );
for( int nCharPos = -1; aLayoutArgs.GetNextPos( &nCharPos, &bRTL);)
{
@@ -7773,7 +7756,7 @@
if( !mpFontEntry )
return sal_False;
-#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
+#ifdef ENABLE_IFC_CACHE // a little font charmap cache helps considerably
static const int NMAXITEMS = 16;
static int nUsedItems = 0, nCurItem = 0;
@@ -7786,11 +7769,11 @@
for( i = nUsedItems; --i >= 0; )
if( pFontData == aCache[i].mpFontData )
break;
- if( i >= 0 ) // found in cache
+ if( i >= 0 ) // found in cache
{
rFontCharMap.Reset( aCache[i].maCharMap.mpImpl );
}
- else // need to cache
+ else // need to cache
#endif // ENABLE_IFC_CACHE
{
const ImplFontCharMap* pNewMap = mpGraphics->GetImplFontCharMap();
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 12b1841..a3a107b 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -59,8 +59,6 @@
int nImplSysDialog = 0;
-// =======================================================================
-
namespace
{
static Paper ImplGetPaperFormat( long nWidth100thMM, long nHeight100thMM )
@@ -70,8 +68,6 @@
return aInfo.getPaper();
}
-// -----------------------------------------------------------------------
-
static const PaperInfo& ImplGetEmptyPaper()
{
static PaperInfo aInfo(PAPER_USER);
@@ -79,7 +75,6 @@
}
}
-// =======================================================================
void ImplUpdateJobSetupPaper( JobSetup& rJobSetup )
{
@@ -103,10 +98,7 @@
}
}
-// ------------------
-// - PrinterOptions -
-// ------------------
-
+// PrinterOptions
PrinterOptions::PrinterOptions() :
mbReduceTransparency( sal_False ),
meReducedTransparencyMode( PRINTER_TRANSPARENCY_AUTO ),
@@ -122,7 +114,6 @@
{
}
-// -----------------------------------------------------------------------
PrinterOptions::~PrinterOptions()
{
@@ -222,17 +213,13 @@
*mpPrinterOptions = i_rOptions;
}
-// -------------
-// - QueueInfo -
-// -------------
-
+// QueueInfo
QueueInfo::QueueInfo()
{
mnStatus = 0;
mnJobs = 0;
}
-// -----------------------------------------------------------------------
QueueInfo::QueueInfo( const QueueInfo& rInfo ) :
maPrinterName( rInfo.maPrinterName ),
@@ -244,13 +231,11 @@
{
}
-// -----------------------------------------------------------------------
QueueInfo::~QueueInfo()
{
}
-// -----------------------------------------------------------------------
bool QueueInfo::operator==( const QueueInfo& rInfo ) const
{
@@ -263,7 +248,6 @@
mnJobs == rInfo.mnJobs;
}
-// -----------------------------------------------------------------------
SvStream& operator<<( SvStream& rOStream, const QueueInfo& rInfo )
{
@@ -279,7 +263,6 @@
return rOStream;
}
-// -----------------------------------------------------------------------
SvStream& operator>>( SvStream& rIStream, QueueInfo& rInfo )
{
@@ -295,7 +278,6 @@
return rIStream;
}
-// =======================================================================
SalPrinterQueueInfo::SalPrinterQueueInfo()
{
@@ -304,13 +286,11 @@
mpSysData = NULL;
}
-// -----------------------------------------------------------------------
SalPrinterQueueInfo::~SalPrinterQueueInfo()
{
}
-// -----------------------------------------------------------------------
ImplPrnQueueList::~ImplPrnQueueList()
{
@@ -322,7 +302,6 @@
}
}
-// -----------------------------------------------------------------------
void ImplPrnQueueList::Add( SalPrinterQueueInfo* pData )
{
@@ -346,7 +325,6 @@
}
}
-// -----------------------------------------------------------------------
ImplPrnQueueData* ImplPrnQueueList::Get( const OUString& rPrinter )
{
@@ -358,7 +336,6 @@
return pData;
}
-// =======================================================================
static void ImplInitPrnQueueList()
{
@@ -371,7 +348,6 @@
pSVData->mpDefInst->GetPrinterQueueInfo( pSVData->maGDIData.mpPrinterQueueList );
}
-// -----------------------------------------------------------------------
void ImplDeletePrnQueueList()
{
@@ -385,17 +361,15 @@
}
}
-// -----------------------------------------------------------------------
const std::vector<OUString>& Printer::GetPrinterQueues()
{
- ImplSVData* pSVData = ImplGetSVData();
+ ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maGDIData.mpPrinterQueueList )
ImplInitPrnQueueList();
return pSVData->maGDIData.mpPrinterQueueList->m_aPrinterList;
}
-// -----------------------------------------------------------------------
const QueueInfo* Printer::GetQueueInfo( const OUString& rPrinterName, bool bStatusUpdate )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -423,7 +397,6 @@
return NULL;
}
-// -----------------------------------------------------------------------
OUString Printer::GetDefaultPrinterName()
{
@@ -437,7 +410,6 @@
return OUString();
}
-// =======================================================================
void Printer::ImplInitData()
{
@@ -461,7 +433,7 @@
mbIsQueuePrinter = sal_False;
mpPrinterOptions = new PrinterOptions;
- // Printer in die Liste eintragen
+ // Add printer to the list
ImplSVData* pSVData = ImplGetSVData();
mpNext = pSVData->maGDIData.mpFirstPrinter;
mpPrev = NULL;
@@ -472,7 +444,6 @@
pSVData->maGDIData.mpFirstPrinter = this;
}
-// -----------------------------------------------------------------------
void Printer::ImplInit( SalPrinterQueueInfo* pInfo )
{
@@ -480,7 +451,7 @@
// #i74084# update info for this specific SalPrinterQueueInfo
pSVData->mpDefInst->GetPrinterQueueState( pInfo );
- // Testen, ob Treiber ueberhaupt mit dem JobSetup uebereinstimmt
+ // Test whether the driver actually matches the JobSetup
ImplJobSetup* pJobSetup = maJobSetup.ImplGetData();
if ( pJobSetup->mpDriverData )
@@ -494,11 +465,11 @@
}
}
- // Printernamen merken
+ // Remember printer name
maPrinterName = pInfo->maPrinterName;
maDriver = pInfo->maDriver;
- // In JobSetup den Printernamen eintragen
+ // Add printer name to JobSetup
pJobSetup->maPrinterName = maPrinterName;
pJobSetup->maDriver = maDriver;
@@ -520,14 +491,13 @@
return;
}
- // Daten initialisieren
+ // Init data
ImplUpdatePageData();
mpFontList = new ImplDevFontList();
mpFontCache = new ImplFontCache( sal_True );
mpGraphics->GetDevFontList( mpFontList );
}
-// -----------------------------------------------------------------------
void Printer::ImplInitDisplay( const Window* pWindow )
{
@@ -547,7 +517,6 @@
mnDPIY = mpDisplayDev->mnDPIY;
}
-// -----------------------------------------------------------------------
SalPrinterQueueInfo* Printer::ImplGetQueueInfo( const OUString& rPrinterName,
const OUString* pDriver )
@@ -593,7 +562,6 @@
return NULL;
}
-// -----------------------------------------------------------------------
void Printer::ImplUpdatePageData()
{
@@ -608,14 +576,12 @@
maPaperSize.Width(), maPaperSize.Height() );
}
-// -----------------------------------------------------------------------
void Printer::ImplUpdateFontList()
{
ImplUpdateFontData( sal_True );
}
-// -----------------------------------------------------------------------
Printer::Printer()
{
@@ -631,7 +597,6 @@
ImplInitDisplay( NULL );
}
-// -----------------------------------------------------------------------
Printer::Printer( const JobSetup& rJobSetup ) :
maJobSetup( rJobSetup )
@@ -651,7 +616,6 @@
}
}
-// -----------------------------------------------------------------------
Printer::Printer( const QueueInfo& rQueueInfo )
{
@@ -664,7 +628,6 @@
ImplInitDisplay( NULL );
}
-// -----------------------------------------------------------------------
Printer::Printer( const OUString& rPrinterName )
{
@@ -676,7 +639,6 @@
ImplInitDisplay( NULL );
}
-// -----------------------------------------------------------------------
Printer::~Printer()
{
@@ -692,8 +654,8 @@
delete mpDisplayDev;
else
{
- // OutputDevice-Dtor versucht das gleiche, deshalb muss hier
- // der FontEntry auch auf NULL gesetzt werden
+ // OutputDevice Dtor is tryig the same thing; that why we need to set
+ // the FontEntry to NULL here
// TODO: consolidate duplicate cleanup by Printer and OutputDevice
if ( mpFontEntry )
{
@@ -715,7 +677,7 @@
// font list deleted by OutputDevice dtor
}
- // Printer aus der Liste eintragen
+ // Add printer from the list
ImplSVData* pSVData = ImplGetSVData();
if ( mpPrev )
mpPrev->mpNext = mpNext;
@@ -727,7 +689,6 @@
pSVData->maGDIData.mpLastPrinter = mpPrev;
}
-// -----------------------------------------------------------------------
void Printer::Compat_OldPrinterMetrics( bool bSet )
{
// propagate flag
@@ -738,7 +699,6 @@
ImplUpdateFontData( sal_True );
}
-// -----------------------------------------------------------------------
sal_uLong Printer::GetCapabilities( sal_uInt16 nType ) const
{
@@ -751,7 +711,6 @@
return sal_False;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::HasSupport( PrinterSupport eFeature ) const
{
@@ -780,7 +739,6 @@
return sal_True;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetJobSetup( const JobSetup& rSetup )
{
@@ -803,7 +761,6 @@
return sal_False;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::Setup( Window* pWindow )
@@ -841,7 +798,6 @@
return sal_False;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetPrinterProps( const Printer* pPrinter )
{
@@ -860,7 +816,7 @@
if ( pPrinter->IsDisplayPrinter() )
{
- // Alten Printer zerstoeren
+ // Destroy old printer
if ( !IsDisplayPrinter() )
{
ImplReleaseGraphics();
@@ -891,12 +847,12 @@
mpInfoPrinter = NULL;
}
- // Neuen Printer bauen
+ // Construct new printer
ImplInitDisplay( NULL );
return sal_True;
}
- // Alten Printer zerstoeren?
+ // Destroy old printer?
if ( GetName() != pPrinter->GetName() )
{
ImplReleaseGraphics();
@@ -933,7 +889,7 @@
mpInfoPrinter = NULL;
}
- // Neuen Printer bauen
+ // Construct new printer
OUString aDriver = pPrinter->GetDriverName();
SalPrinterQueueInfo* pInfo = ImplGetQueueInfo( pPrinter->GetName(), &aDriver );
if ( pInfo )
@@ -950,7 +906,6 @@
return sal_False;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetOrientation( Orientation eOrientation )
{
@@ -987,14 +942,12 @@
return sal_True;
}
-// -----------------------------------------------------------------------
Orientation Printer::GetOrientation() const
{
return maJobSetup.ImplGetConstData()->meOrientation;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetPaperBin( sal_uInt16 nPaperBin )
{
@@ -1032,14 +985,12 @@
return sal_True;
}
-// -----------------------------------------------------------------------
sal_uInt16 Printer::GetPaperBin() const
{
return maJobSetup.ImplGetConstData()->mnPaperBin;
}
-// -----------------------------------------------------------------------
// Map user paper format to a available printer paper formats
void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNearest )
@@ -1052,7 +1003,7 @@
PaperInfo aInfo(pSetupData->mnPaperWidth, pSetupData->mnPaperHeight);
- // Alle Papierformate vergleichen und ein passendes raussuchen
+ // Compare all paper formats and get the appropriate one
for ( int i = 0; i < nPaperCount; i++ )
{
const PaperInfo& rPaperInfo = GetPaperInfo( i );
@@ -1101,7 +1052,7 @@
{
const PaperInfo& rPaperInfo = GetPaperInfo( i );
- // check protrait match
+ // check portrait match
sal_Int64 nDX = pSetupData->mnPaperWidth - rPaperInfo.getWidth();
sal_Int64 nDY = pSetupData->mnPaperHeight - rPaperInfo.getHeight();
sal_Int64 nMatch = nDX*nDX + nDY*nDY;
@@ -1130,7 +1081,6 @@
}
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetPaper( Paper ePaper )
{
@@ -1175,7 +1125,6 @@
return sal_True;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetPaperSizeUser( const Size& rSize )
{
@@ -1226,7 +1175,6 @@
return sal_True;
}
-// -----------------------------------------------------------------------
int Printer::GetPaperInfoCount() const
{
@@ -1237,7 +1185,6 @@
return mpInfoPrinter->m_aPaperFormats.size();
}
-// -----------------------------------------------------------------------
OUString Printer::GetPaperName( Paper ePaper )
{
@@ -1269,7 +1216,6 @@
return (it != pSVData->mpPaperNames->end()) ? it->second : OUString();
}
-// -----------------------------------------------------------------------
OUString Printer::GetPaperName( bool i_bPaperUser ) const
{
@@ -1280,7 +1226,6 @@
return (ePaper != PAPER_USER || i_bPaperUser ) ? GetPaperName( ePaper ) : OUString();
}
-// -----------------------------------------------------------------------
const PaperInfo& Printer::GetPaperInfo( int nPaper ) const
{
@@ -1293,7 +1238,6 @@
return mpInfoPrinter->m_aPaperFormats[nPaper];
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex )
{
@@ -1330,21 +1274,18 @@
return sal_True;
}
-// -----------------------------------------------------------------------
int Printer::GetLandscapeAngle() const
{
return mpInfoPrinter ? mpInfoPrinter->GetLandscapeAngle( maJobSetup.ImplGetConstData() ) : 900;
}
-// -----------------------------------------------------------------------
Paper Printer::GetPaper() const
{
return maJobSetup.ImplGetConstData()->mePaperFormat;
}
-// -----------------------------------------------------------------------
sal_uInt16 Printer::GetPaperBinCount() const
{
@@ -1354,7 +1295,6 @@
return (sal_uInt16)mpInfoPrinter->GetPaperBinCount( maJobSetup.ImplGetConstData() );
}
-// -----------------------------------------------------------------------
OUString Printer::GetPaperBinName( sal_uInt16 nPaperBin ) const
{
@@ -1367,7 +1307,6 @@
return ImplGetSVEmptyStr();
}
-// -----------------------------------------------------------------------
sal_Bool Printer::SetCopyCount( sal_uInt16 nCopy, sal_Bool bCollate )
{
@@ -1376,14 +1315,12 @@
return sal_True;
}
-// -----------------------------------------------------------------------
void Printer::Error()
{
maErrorHdl.Call( this );
}
-// -----------------------------------------------------------------------
sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError )
@@ -1405,7 +1342,6 @@
return nVCLError;
}
-// -----------------------------------------------------------------------
sal_Bool Printer::EndJob()
{
@@ -1429,9 +1365,9 @@
mbDevOutput = sal_False;
bRet = mpPrinter->EndJob();
- // Hier den Drucker nicht asyncron zerstoeren, da es
- // W95 nicht verkraftet, wenn gleichzeitig gedruckt wird
- // und ein Druckerobjekt zerstoert wird
+ // FIXME: Do not destroy the printer asynchronously as Win95
+ // can't handle destroying a printer object and printing
+ // at the same time
ImplGetSVData()->mpDefInst->DestroyPrinter( mpPrinter );
mpPrinter = NULL;
}
@@ -1439,7 +1375,6 @@
return bRet;
}
-// -----------------------------------------------------------------------
void Printer::ImplStartPage()
{
@@ -1466,7 +1401,6 @@
}
}
-// -----------------------------------------------------------------------
void Printer::ImplEndPage()
{
@@ -1486,7 +1420,6 @@
}
}
-// -----------------------------------------------------------------------
void Printer::updatePrinters()
{
--
To view, visit https://gerrit.libreoffice.org/3294
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I68a1285355b14e122f218b2f483ebc74a2b2dbaf
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Philipp Weissenbacher <p.weissenbacher@gmail.com>
Context
- [PATCH] Translate German comments and general clean-up · Philipp Weissenbacher (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.