[Libreoffice-commits] core.git: vcl/generic vcl/source
vcl/generic/glyphs/gcach_layout.cxx |6 ++ vcl/source/outdev/font.cxx |5 - 2 files changed, 10 insertions(+), 1 deletion(-) New commits: commit f76ecc3e9ce51b35fc18db55b808270079a3652b Author: Caolán McNamara caol...@redhat.com Date: Tue May 26 15:45:30 2015 +0100 Resolves: tdf#89231 if no font has 0x202F fallback to a normal space Change-Id: I2325c0b09ccf66ee15597251ad027b295de5502f diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index 0eecae5..8d1c6f5 100644 --- a/vcl/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx @@ -488,6 +488,12 @@ bool HbLayoutEngine::Layout(ServerFontLayout rLayout, ImplLayoutArgs rArgs) int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint; int32_t nCharPos = pHbGlyphInfos[i].cluster; +// tdf#89231 if it's just a missing non-breaking space, then use a normal space +if (!nGlyphIndex (SalLayoutFlags::ForFallback rArgs.mnFlags) nCharPos = 0 rArgs.mpStr[nCharPos] == 0x202F) +{ +nGlyphIndex = rFont.GetGlyphIndex(' '); +} + // if needed request glyph fallback by updating LayoutArgs if (!nGlyphIndex) { diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 40bd5cd..216c8a6 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -2104,7 +2104,10 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay if( nFallbackLevel MAX_FALLBACK-1) { // ignore fallback font if it is the same as the original font -if( mpFontEntry-maFontSelData.mpFontData == aFontSelData.mpFontData ) +// unless we are looking for a substituion for 0x202F, in which +// case we'll just use a normal space +if( mpFontEntry-maFontSelData.mpFontData == aFontSelData.mpFontData +aMissingCodes.indexOf(0x202F) == -1 ) { mpFontCache-Release( pFallbackFont ); continue; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/generic vcl/source
vcl/generic/print/genprnpsp.cxx |2 +- vcl/source/src/print.src|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit c067735f222d41698f4353fa7cbeaeb432573405 Author: Caolán McNamara caol...@redhat.com Date: Fri Apr 4 09:43:09 2014 +0100 make query fax number dialog a little less lame Change-Id: I73e68fcbbff5d153196e5ad617e04c3d5c52e513 diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index 12ffe7a..2b92a64 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -117,7 +117,7 @@ namespace m_pOKButton-SetClickHdl(LINK(this, QueryString, ClickBtnHdl)); m_pFixedText-SetText(rQuery); m_pEdit-SetText(m_rReturnValue); -SetText(Application::GetDisplayName()); +SetText(rQuery); } IMPL_LINK( QueryString, ClickBtnHdl, Button*, pButton ) diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src index e959e92..cbfe6ed 100644 --- a/vcl/source/src/print.src +++ b/vcl/source/src/print.src @@ -107,7 +107,7 @@ Image SV_PRINT_NOCOLLATE_IMG String SV_PRINT_QUERYFAXNUMBER_TXT { -Text [ en-US ] = Please enter the fax number.; +Text [ en-US ] = Please enter the fax number; }; String SV_PRINT_INVALID_TXT ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/generic vcl/source
vcl/generic/fontmanager/helper.cxx | 13 vcl/source/app/dbggui.cxx |7 ++ vcl/source/control/edit.cxx| 40 + 3 files changed, 23 insertions(+), 37 deletions(-) New commits: commit 59b428189d14da78e761c8dbb8bd8ba7de4fa511 Author: Takeshi Abe t...@fixedpoint.jp Date: Tue Mar 11 09:24:30 2014 +0900 Avoid possible resource leaks by boost::scoped_array Change-Id: I3a9131d75690e18caec4c328934735a9ca19e7ca diff --git a/vcl/generic/fontmanager/helper.cxx b/vcl/generic/fontmanager/helper.cxx index 729d526..a35264f 100644 --- a/vcl/generic/fontmanager/helper.cxx +++ b/vcl/generic/fontmanager/helper.cxx @@ -31,6 +31,7 @@ #include tools/urlobj.hxx #include vcl/helper.hxx #include vcl/ppdparser.hxx +#include boost/scoped_array.hpp using ::rtl::Bootstrap; @@ -284,15 +285,15 @@ bool psp::convertPfbToPfa( ::osl::File rInFile, ::osl::File rOutFile ) } else if( nType == 1 || nType == 2 ) { -unsigned char* pBuffer = new unsigned char[ nBytesToRead+1 ]; +boost::scoped_arrayunsigned char pBuffer(new unsigned char[ nBytesToRead+1 ]); -if( ! rInFile.read( pBuffer, nBytesToRead, nRead ) nRead == nBytesToRead ) +if( ! rInFile.read( pBuffer.get(), nBytesToRead, nRead ) nRead == nBytesToRead ) { if( nType == 1 ) { // ascii data, convert dos lineends( \r\n ) and // m_ac lineends( \r ) to \n -unsigned char * pWriteBuffer = new unsigned char[ nBytesToRead ]; +boost::scoped_arrayunsigned char pWriteBuffer(new unsigned char[ nBytesToRead ]); unsigned int nBytesToWrite = 0; for( unsigned int i = 0; i nBytesToRead; i++ ) { @@ -306,10 +307,8 @@ bool psp::convertPfbToPfa( ::osl::File rInFile, ::osl::File rOutFile ) else pWriteBuffer[ nBytesToWrite++ ] = '\n'; } -if( rOutFile.write( pWriteBuffer, nBytesToWrite, nRead ) || nRead != nBytesToWrite ) +if( rOutFile.write( pWriteBuffer.get(), nBytesToWrite, nRead ) || nRead != nBytesToWrite ) bSuccess = false; - -delete [] pWriteBuffer; } else { @@ -337,8 +336,6 @@ bool psp::convertPfbToPfa( ::osl::File rInFile, ::osl::File rOutFile ) } else bSuccess = false; - -delete [] pBuffer; } else if( nType == 3 ) bEof = true; diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index ac2cdd0..81c32b2 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -58,6 +58,7 @@ #include map #include algorithm +#include boost/scoped_array.hpp #include boost/scoped_ptr.hpp using namespace ::com::sun::star; @@ -1090,8 +1091,8 @@ void DbgDialogTest( Window* pWindow ) if ( !pGetChild ) return; -Rectangle* pRectAry = (Rectangle*)new long[(sizeof(Rectangle)*nChildCount)/sizeof(long)]; -memset( pRectAry, 0, sizeof(Rectangle)*nChildCount ); +boost::scoped_arrayRectangle pRectAry((Rectangle*)new long[(sizeof(Rectangle)*nChildCount)/sizeof(long)]); +memset( pRectAry.get(), 0, sizeof(Rectangle)*nChildCount ); if ( pWindow-IsDialog() ) { @@ -1433,8 +1434,6 @@ void DbgDialogTest( Window* pWindow ) pGetChild = pGetChild-GetWindow( WINDOW_NEXT ); i++; } - -delete [] pRectAry; } #ifndef WNT diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 0a2170e..0803532 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -67,6 +67,7 @@ #include vcl/unohelp2.hxx #include officecfg/Office/Common.hxx +#include boost/scoped_array.hpp using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -486,15 +487,15 @@ void Edit::ImplRepaint(bool bLayout) sal_Int32 nLen = aText.getLength(); sal_Int32 nDXBuffer[256]; -sal_Int32* pDXBuffer = NULL; +boost::scoped_arraysal_Int32 pDXBuffer; sal_Int32* pDX = nDXBuffer; if( !aText.isEmpty() ) { if( (size_t) (2*aText.getLength()) SAL_N_ELEMENTS(nDXBuffer) ) { -pDXBuffer = new sal_Int32[2*(aText.getLength()+1)]; -pDX = pDXBuffer; +pDXBuffer.reset(new sal_Int32[2*(aText.getLength()+1)]); +pDX = pDXBuffer.get(); } GetCaretPositions( aText, pDX, 0, nLen ); @@ -512,7 +513,6 @@ void Edit::ImplRepaint(bool bLayout) DrawText( aPos, aText, 0, nLen, pVector, pDisplayText ); -delete [] pDXBuffer; return; } @@ -693,8 +693,6 @@ void Edit::ImplRepaint(bool bLayout) if ( bVisCursor ( !mpIMEInfos
[Libreoffice-commits] core.git: vcl/generic vcl/source
vcl/generic/print/bitmap_gfx.cxx| 36 +++- vcl/source/app/dbggui.cxx |4 ++-- vcl/source/edit/texteng.cxx |5 +++-- vcl/source/filter/graphicfilter.cxx | 15 ++- vcl/source/gdi/bitmapex.cxx | 19 ++- 5 files changed, 32 insertions(+), 47 deletions(-) New commits: commit e0e2f4c988af9dc73c7b3ce086efddc0a918406d Author: Takeshi Abe t...@fixedpoint.jp Date: Fri Mar 7 16:34:17 2014 +0900 Avoid possible resource leaks with boost::scoped_ptr Change-Id: I835bec5c43b7b4a8638d5032b720661fc2f1397f diff --git a/vcl/generic/print/bitmap_gfx.cxx b/vcl/generic/print/bitmap_gfx.cxx index 6ea8e33..f929944 100644 --- a/vcl/generic/print/bitmap_gfx.cxx +++ b/vcl/generic/print/bitmap_gfx.cxx @@ -23,6 +23,8 @@ #include generic/printergfx.hxx #include vcl/strhelper.hxx +#include boost/scoped_ptr.hpp + namespace psp { const sal_uInt32 nLineLength = 80; @@ -489,7 +491,7 @@ PrinterGfx::DrawPS1GrayImage (const PrinterBmp rBitmap, const Rectangle rArea) WritePS (mpPageBody, pGrayImage); // image body -HexEncoder* pEncoder = new HexEncoder (mpPageBody); +boost::scoped_ptrHexEncoder pEncoder(new HexEncoder (mpPageBody)); for (long nRow = rArea.Top(); nRow = rArea.Bottom(); nRow++) { @@ -500,7 +502,7 @@ PrinterGfx::DrawPS1GrayImage (const PrinterBmp rBitmap, const Rectangle rArea) } } -delete pEncoder; +pEncoder.reset(); WritePS (mpPageBody, \n); } @@ -572,8 +574,8 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp rBitmap, psp::ImageType nType) nChar += psp::appendStr (\npsp_ascii85string\n, pImage + nChar); WritePS (mpPageBody, pImage); -ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody) - : new Ascii85Encoder(mpPageBody); +boost::scoped_ptrByteEncoder pEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody) +: new Ascii85Encoder(mpPageBody)); for (sal_uInt32 i = 0; i nSize; i++) { PrinterColor aColor = rBitmap.GetPaletteColor(i); @@ -582,7 +584,7 @@ PrinterGfx::writePS2Colorspace(const PrinterBmp rBitmap, psp::ImageType nType) pEncoder-EncodeByte (aColor.GetGreen()); pEncoder-EncodeByte (aColor.GetBlue()); } -delete pEncoder; +pEncoder.reset(); WritePS (mpPageBody, pop ] setcolorspace\n); } @@ -597,8 +599,8 @@ PrinterGfx::DrawPS2GrayImage (const PrinterBmp rBitmap, const Rectangle rArea) writePS2Colorspace(rBitmap, psp::GrayScaleImage); writePS2ImageHeader(rArea, psp::GrayScaleImage); -ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody) - : new Ascii85Encoder(mpPageBody); +boost::scoped_ptrByteEncoder pEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody) +: new Ascii85Encoder(mpPageBody)); for (long nRow = rArea.Top(); nRow = rArea.Bottom(); nRow++) { @@ -608,8 +610,6 @@ PrinterGfx::DrawPS2GrayImage (const PrinterBmp rBitmap, const Rectangle rArea) pEncoder-EncodeByte (nByte); } } - -delete pEncoder; } void @@ -618,8 +618,8 @@ PrinterGfx::DrawPS2MonoImage (const PrinterBmp rBitmap, const Rectangle rArea) writePS2Colorspace(rBitmap, psp::MonochromeImage); writePS2ImageHeader(rArea, psp::MonochromeImage); -ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody) - : new Ascii85Encoder(mpPageBody); +boost::scoped_ptrByteEncoder pEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody) +: new Ascii85Encoder(mpPageBody)); for (long nRow = rArea.Top(); nRow = rArea.Bottom(); nRow++) { @@ -643,8 +643,6 @@ PrinterGfx::DrawPS2MonoImage (const PrinterBmp rBitmap, const Rectangle rArea) if (nBitPos != 0) pEncoder-EncodeByte (nByte); } - -delete pEncoder; } void @@ -653,8 +651,8 @@ PrinterGfx::DrawPS2PaletteImage (const PrinterBmp rBitmap, const Rectangle rAr writePS2Colorspace(rBitmap, psp::PaletteImage); writePS2ImageHeader(rArea, psp::PaletteImage); -ByteEncoder* pEncoder = mbCompressBmp ? new LZWEncoder(mpPageBody) - : new Ascii85Encoder(mpPageBody); +boost::scoped_ptrByteEncoder pEncoder(mbCompressBmp ? new LZWEncoder(mpPageBody) +: new Ascii85Encoder(mpPageBody)); for (long nRow = rArea.Top(); nRow = rArea.Bottom(); nRow++) { @@ -664,8 +662,6 @@ PrinterGfx::DrawPS2PaletteImage (const PrinterBmp rBitmap, const Rectangle rAr pEncoder-EncodeByte (nByte); } } - -delete
[Libreoffice-commits] core.git: vcl/generic vcl/source
vcl/generic/fontmanager/fontsubst.cxx |8 vcl/source/gdi/outdev3.cxx|8 2 files changed, 8 insertions(+), 8 deletions(-) New commits: commit 3384f229a4a3812f57bd8864e9c916e6443a4899 Author: ricardobotto andarilho.bo...@gmail.com Date: Sat May 18 16:24:19 2013 -0300 Changed compareTo to startsWith Change-Id: Ia72e220f29c26bdf789bd3f1102b850aafcf525d Reviewed-on: https://gerrit.libreoffice.org/3956 Reviewed-by: Thomas Arnhold tho...@arnhold.org Tested-by: Thomas Arnhold tho...@arnhold.org diff --git a/vcl/generic/fontmanager/fontsubst.cxx b/vcl/generic/fontmanager/fontsubst.cxx index 94dcda1..36c683d 100644 --- a/vcl/generic/fontmanager/fontsubst.cxx +++ b/vcl/generic/fontmanager/fontsubst.cxx @@ -160,8 +160,8 @@ bool FcPreMatchSubstititution::FindFontSubstitute( FontSelectPattern rFontSelDa if( rFontSelData.IsSymbolFont() ) return false; // StarSymbol is a unicode font, but it still deserves the symbol flag -if( 0 == rFontSelData.maSearchName.compareTo( starsymbol, 10) -|| 0 == rFontSelData.maSearchName.compareTo( opensymbol, 10) ) +if(rFontSelData.maSearchName.startsWith( starsymbol ) +|| rFontSelData.maSearchName.startsWith( opensymbol ) ) return false; //see fdo#41556 and fdo#47636 @@ -229,8 +229,8 @@ bool FcGlyphFallbackSubstititution::FindFontSubstitute( FontSelectPattern rFont if( rFontSelData.IsSymbolFont() ) return false; // StarSymbol is a unicode font, but it still deserves the symbol flag -if( 0 == rFontSelData.maSearchName.compareTo( starsymbol, 10) -|| 0 == rFontSelData.maSearchName.compareTo( opensymbol, 10) ) +if(rFontSelData.maSearchName.startsWith( starsymbol ) +|| rFontSelData.maSearchName.startsWith( opensymbol ) ) return false; const FontSelectPattern aOut = GetFcSubstitute( rFontSelData, rMissingCodes ); diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 573b472..5274634 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -695,8 +695,8 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes rDFA, int nMagi { // StarSymbol is a unicode font, but it still deserves the symbol flag if( !IsSymbolFont() ) -if( 0 == GetFamilyName().compareTo( starsymbol, 10) -|| 0 == GetFamilyName().compareTo( opensymbol, 10) ) +if( GetFamilyName().startsWith( starsymbol) +|| GetFamilyName().startsWith( opensymbol) ) SetSymbolFlag( true ); } @@ -755,11 +755,11 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern rFSD, FontMatchSt int nMatch = 0; const OUString rFontName = rFSD.maTargetName; -if( (rFontName == GetFamilyName()) || rFontName.compareTo( GetFamilyName() ) ) +if( (rFontName == GetFamilyName()) || rFontName == GetFamilyName() ) nMatch += 24; if( rStatus.mpTargetStyleName - GetStyleName().compareTo( rStatus.mpTargetStyleName ) ) + GetStyleName() == rStatus.mpTargetStyleName ) nMatch += 12; if( (rFSD.GetPitch() != PITCH_DONTKNOW) (rFSD.GetPitch() == GetPitch()) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits