diff options
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/directx/dx_canvasfont.cxx | 8 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvashelper.cxx | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/canvas/source/directx/dx_canvasfont.cxx b/canvas/source/directx/dx_canvasfont.cxx index 0fa32688ea6f..5bf74ccc0d2e 100644 --- a/canvas/source/directx/dx_canvasfont.cxx +++ b/canvas/source/directx/dx_canvasfont.cxx @@ -18,6 +18,7 @@ */ #include <sal/config.h> +#include <o3tl/char16_t2wchar_t.hxx> #include <com/sun/star/rendering/PanoseWeight.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> @@ -56,12 +57,7 @@ namespace dxcanvas maFontRequest( rFontRequest ), maFontMatrix( fontMatrix ) { - const sal_Int32 nLen(rFontRequest.FontDescription.FamilyName.getLength()); - const sal_Unicode* pStr(rFontRequest.FontDescription.FamilyName.getStr()); - std::vector< sal_Unicode > pStrBuf(nLen+1,0); - std::copy(pStr,pStr+nLen,&pStrBuf[0]); - - mpFontFamily.reset( new Gdiplus::FontFamily(SAL_W(&pStrBuf[0]),nullptr) ); + mpFontFamily.reset( new Gdiplus::FontFamily(o3tl::toW(rFontRequest.FontDescription.FamilyName.getStr()),nullptr) ); if( !mpFontFamily->IsAvailable() ) mpFontFamily.reset( new Gdiplus::FontFamily(L"Arial",nullptr) ); diff --git a/canvas/source/directx/dx_canvashelper.cxx b/canvas/source/directx/dx_canvashelper.cxx index 87b9066fc08f..86222437d090 100644 --- a/canvas/source/directx/dx_canvashelper.cxx +++ b/canvas/source/directx/dx_canvashelper.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/rendering/RepaintResult.hpp> #include <com/sun/star/rendering/TexturingMode.hpp> #include <comphelper/sequence.hxx> +#include <o3tl/char16_t2wchar_t.hxx> #include <rtl/math.hxx> #include <tools/diagnose_ex.h> @@ -521,7 +522,7 @@ namespace dxcanvas // TODO(F2): Proper layout (BiDi, CTL)! IMHO must use // DrawDriverString here, and perform layouting myself... ENSURE_OR_THROW( - Gdiplus::Ok == pGraphics->DrawString( SAL_W(text.Text.copy( text.StartPosition, + Gdiplus::Ok == pGraphics->DrawString( o3tl::toW(text.Text.copy( text.StartPosition, text.Length ).getStr()), text.Length, pFont->getFont().get(), |