[ooo-build-commit] Branch 'ooo/OOO320' - 2 commits - vcl/aqua vcl/unx vcl/win
Jan Holesovsky
kendy at kemper.freedesktop.org
Thu Dec 3 21:00:31 PST 2009
vcl/aqua/source/gdi/salatslayout.cxx | 30 +++++++++++--
vcl/aqua/source/gdi/salgdi.cxx | 12 +++++
vcl/aqua/source/window/salframeview.mm | 21 +++++++++
vcl/unx/source/printergfx/common_gfx.cxx | 68 ++++++++++---------------------
vcl/win/source/gdi/salgdi3.cxx | 2
5 files changed, 81 insertions(+), 52 deletions(-)
New commits:
commit 1652829a054ea8a7b5e687f6de3aea3b73a3dc10
Author: Oliver Bolte <obo at openoffice.org>
Date: Tue Dec 1 10:53:27 2009 +0000
CWS-TOOLING: integrate CWS ooo32gsl07
2009-11-24 09:00:19 +0100 hdu r277603 : #i107076# device DPI also gets a maximum limit
2009-11-23 11:43:01 +0100 hdu r277593 : #i107076# device DPI now gets a minimum limit
2009-11-20 16:41:39 +0100 hdu r277582 : #ii107076# limit minimal device resolution
2009-11-20 13:42:09 +0100 af r277578 : #i107049# Do not scroll focus indicator into view when slide sorter is focused.
2009-11-20 11:31:54 +0100 aw r277576 : ooo32gsl07 #i106214# corrected MinAutoPaperSize for Cell BlockFormatting
2009-11-20 10:28:09 +0100 hdu r277573 : #i107006# text justification invalidates previous measurements of a layout
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx
index 2c70739..3419c2d 100755
--- a/vcl/aqua/source/gdi/salatslayout.cxx
+++ b/vcl/aqua/source/gdi/salatslayout.cxx
@@ -70,12 +70,13 @@ private:
// to prevent ATS overflowing the Fixed16.16 values
// ATS font requests get size limited by downscaling huge fonts
// in these cases the font scale becomes something bigger than 1.0
- float mfFontScale;
+ float mfFontScale;
private:
bool InitGIA( ImplLayoutArgs* pArgs = NULL ) const;
bool GetIdealX() const;
bool GetDeltaY() const;
+ void InvalidateMeasurements();
int Fixed2Vcl( Fixed ) const; // convert ATSU-Fixed units to VCL units
int AtsuPix2Vcl( int ) const; // convert ATSU-Pixel units to VCL units
@@ -312,7 +313,7 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
mnTrailingSpaceWidth += rArgs.mpDXArray[i];
if( i > 0 )
mnTrailingSpaceWidth -= rArgs.mpDXArray[i-1];
- InitGIA(); // ensure valid mpCharWidths[]
+ InitGIA(); // ensure valid mpCharWidths[], TODO: use GetIdealX() instead?
mnTrailingSpaceWidth -= Fixed2Vcl( mpCharWidths[i] );
// ignore trailing space for calculating the available width
nOrigWidth -= mnTrailingSpaceWidth;
@@ -326,11 +327,15 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
if( !nPixelWidth )
return;
- // HACK: justification requests which change the width by just one pixel are probably
+ // HACK: justification requests which change the width by just one pixel were probably
// #i86038# introduced by lossy conversions between integer based coordinate system
+ // => ignoring such requests has many more benefits than eventual drawbacks
if( (nOrigWidth >= nPixelWidth-1) && (nOrigWidth <= nPixelWidth+1) )
return;
+ // changing the layout will make all previous measurements invalid
+ InvalidateMeasurements();
+
ATSUAttributeTag nTags[3];
ATSUAttributeValuePtr nVals[3];
ByteCount nBytes[3];
@@ -354,7 +359,7 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs )
if( eStatus != noErr )
return;
- // check result of the justied layout
+ // update the measurements of the justified layout to match the justification request
if( rArgs.mpDXArray )
InitGIA( &rArgs );
}
@@ -1071,6 +1076,23 @@ bool ATSLayout::GetDeltaY() const
return true;
}
+// -----------------------------------------------------------------------
+
+#define DELETEAZ( X ) { delete[] X; X = NULL; }
+
+void ATSLayout::InvalidateMeasurements()
+{
+ mnGlyphCount = -1;
+ DELETEAZ( mpGlyphIds );
+ DELETEAZ( mpCharWidths );
+ DELETEAZ( mpChars2Glyphs );
+ DELETEAZ( mpGlyphs2Chars );
+ DELETEAZ( mpGlyphRTLFlags );
+ DELETEAZ( mpGlyphAdvances );
+ DELETEAZ( mpGlyphOrigAdvs );
+ DELETEAZ( mpDeltaY );
+}
+
// =======================================================================
#if 0
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index fdef1a7..e2a12f1 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -404,9 +404,19 @@ void AquaSalGraphics::initResolution( NSWindow* pWin )
DBG_ERROR( "no screen found" );
}
+ // #i107076# maintaining size-WYSIWYG-ness causes many problems for
+ // low-DPI, high-DPI or for mis-reporting devices
+ // => it is better to limit the calculation result then
+ static const int nMinDPI = 72;
+ if( (mnRealDPIX < nMinDPI) || (mnRealDPIY < nMinDPI) )
+ mnRealDPIX = mnRealDPIY = nMinDPI;
+ static const int nMaxDPI = 200;
+ if( (mnRealDPIX > nMaxDPI) || (mnRealDPIY > nMaxDPI) )
+ mnRealDPIX = mnRealDPIY = nMaxDPI;
+
// for OSX any anisotropy reported for the display resolution is best ignored (e.g. TripleHead2Go)
mnRealDPIX = mnRealDPIY = (mnRealDPIX + mnRealDPIY + 1) / 2;
-
+
pSalData->mnDPIX = mnRealDPIX;
pSalData->mnDPIY = mnRealDPIY;
}
commit 3d7f165b0fb1d79254eb26b8f65e77a325553a9d
Author: Oliver Bolte <obo at openoffice.org>
Date: Tue Dec 1 07:43:00 2009 +0000
CWS-TOOLING: integrate CWS ooo32gsl06
2009-11-18 10:37:27 +0100 hdu r277545 : #i106980# fix psprinting of hairline beziers (thanks thb!)
2009-11-17 14:37:57 +0100 pl r277536 : #i106901# work around a crash when getting input from keyboard viewer
2009-11-17 11:43:07 +0100 pl r277530 : #i106863# directory can be empty
2009-11-16 12:37:51 +0100 hdu r277512 : #i106941# register app-specific fonts again after the 3-layer changes for OOo32
2009-11-13 10:17:24 +0100 hdu r277491 : #i105238 fix spelling of monospaced bitstream and dejavu fallbacks
diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm
index 68ea2c2..a1d94a1 100755
--- a/vcl/aqua/source/window/salframeview.mm
+++ b/vcl/aqua/source/window/salframeview.mm
@@ -1328,11 +1328,32 @@ private:
{
mbNeedSpecialKeyHandle = true;
}
+
+ // FIXME:
+ // #i106901#
+ // if we come here outside of mbInKeyInput, this is likely to be because
+ // of the keyboard viewer. For unknown reasons having no marked range
+ // in this case causes a crash. So we say we have a marked range anyway
+ // This is a hack, since it is not understood what a) causes that crash
+ // and b) why we should have a marked range at this point.
+ if( ! mbInKeyInput )
+ bHasMarkedText = YES;
+
return bHasMarkedText;
}
- (NSRange)markedRange
{
+ // FIXME:
+ // #i106901#
+ // if we come here outside of mbInKeyInput, this is likely to be because
+ // of the keyboard viewer. For unknown reasons having no marked range
+ // in this case causes a crash. So we say we have a marked range anyway
+ // This is a hack, since it is not understood what a) causes that crash
+ // and b) why we should have a marked range at this point.
+ if( ! mbInKeyInput )
+ return NSMakeRange( 0, 0 );
+
return [self hasMarkedText] ? mMarkedRange : NSMakeRange( NSNotFound, 0 );
}
diff --git a/vcl/unx/source/printergfx/common_gfx.cxx b/vcl/unx/source/printergfx/common_gfx.cxx
index bd47777..cca74e0 100644
--- a/vcl/unx/source/printergfx/common_gfx.cxx
+++ b/vcl/unx/source/printergfx/common_gfx.cxx
@@ -7,7 +7,6 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: common_gfx.cxx,v $
- * $Revision: 1.20.18.1 $
*
* This file is part of OpenOffice.org.
*
@@ -535,70 +534,49 @@ PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BY
const sal_uInt32 nBezString = 1024;
sal_Char pString[nBezString];
- if ( maLineColor.Is() && nPoints && pPath )
+ if ( nPoints > 1 && maLineColor.Is() && pPath )
{
PSSetColor (maLineColor);
PSSetColor ();
PSSetLineWidth ();
- if (pFlgAry[0] != POLY_NORMAL) //There must be a starting point to moveto
- {
- return;
- }
- else
- {
- snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
- WritePS(mpPageBody, pString);
- }
+ snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y());
+ WritePS(mpPageBody, pString);
// Handle the drawing of mixed lines mixed with curves
// - a normal point followed by a normal point is a line
// - a normal point followed by 2 control points and a normal point is a curve
for (unsigned int i=1; i<nPoints;)
{
- if (pFlgAry[i+1] != POLY_CONTROL) //If the next point is a POLY_NORMAL, we're drawing a line
+ if (pFlgAry[i] != POLY_CONTROL) //If the next point is a POLY_NORMAL, we're drawing a line
{
- if (i+1 >= nPoints) return; //Make sure we don't pass the end of the array
snprintf(pString, nBezString, "%li %li lineto\n", pPath[i].X(), pPath[i].Y());
i++;
}
else //Otherwise we're drawing a spline
{
- if (i+3 >= nPoints) return; //Make sure we don't pass the end of the array
- snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
- pPath[i+1].X(), pPath[i+1].Y(),
- pPath[i+2].X(), pPath[i+2].Y(),
- pPath[i+3].X(), pPath[i+3].Y());
+ if (i+2 >= nPoints)
+ return; //Error: wrong sequence of contol/normal points somehow
+ if ((pFlgAry[i] == POLY_CONTROL) && (pFlgAry[i+1] == POLY_CONTROL) &&
+ (pFlgAry[i+2] != POLY_CONTROL))
+ {
+ snprintf(pString, nBezString, "%li %li %li %li %li %li curveto\n",
+ pPath[i].X(), pPath[i].Y(),
+ pPath[i+1].X(), pPath[i+1].Y(),
+ pPath[i+2].X(), pPath[i+2].Y());
+ }
+ else
+ {
+ DBG_ERROR( "PrinterGfx::DrawPolyLineBezier: Strange output" );
+ }
i+=3;
}
WritePS(mpPageBody, pString);
}
- }
-
- // if eofill and stroke, save the current path
- if( maFillColor.Is() && maLineColor.Is())
- PSGSave();
- // first draw area
- if( maFillColor.Is() )
- {
- PSSetColor (maFillColor);
- PSSetColor ();
- WritePS (mpPageBody, "eofill\n");
- }
-
- // restore the current path
- if( maFillColor.Is() && maLineColor.Is())
- PSGRestore();
-
- // now draw outlines
- if( maLineColor.Is() )
- {
- PSSetColor (maLineColor);
- PSSetColor ();
- PSSetLineWidth ();
+ // now draw outlines
WritePS (mpPageBody, "stroke\n");
- }
+ }
}
void
@@ -635,7 +613,7 @@ PrinterGfx::DrawPolygonBezier (sal_uInt32 nPoints, const Point* pPath, const BYT
}
else
{
- fprintf(stderr, "Strange output\n");
+ DBG_ERROR( "PrinterGfx::DrawPolygonBezier: Strange output" );
}
i+=3;
}
@@ -699,9 +677,7 @@ PrinterGfx::DrawPolyPolygonBezier (sal_uInt32 nPoly, const sal_uInt32 * pPoints,
}
else
{
-#if OSL_DEBUG_LEVEL > 1
- fprintf(stderr, "Strange output\n");
-#endif
+ DBG_ERROR( "PrinterGfx::DrawPolyPolygonBezier: Strange output" );
}
j+=3;
}
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 7ff4527..d3841d0 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -2162,7 +2162,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
::rtl::OUString aExecutableFile( aPath );
aPath = aPath.copy( 0, aPath.lastIndexOf('/') );
String aFontDirUrl = aPath.copy( 0, aPath.lastIndexOf('/') );
- aFontDirUrl += String( RTL_CONSTASCII_USTRINGPARAM("/share/fonts/truetype") );
+ aFontDirUrl += String( RTL_CONSTASCII_USTRINGPARAM("/Basis/share/fonts/truetype") );
// collect fonts in font path that could not be registered
osl::Directory aFontDir( aFontDirUrl );
More information about the ooo-build-commit
mailing list