23 #include <com/sun/star/i18n/WordType.hpp>
24 #include <com/sun/star/i18n/XBreakIterator.hpp>
25 #include <com/sun/star/linguistic2/LinguServiceManager.hpp>
29 #include <rtl/ustrbuf.hxx>
42 #include <config_fuzzers.h>
46 #include <textlayout.hxx>
51 #define TEXT_DRAW_ELLIPSIS (DrawTextFlags::EndEllipsis | DrawTextFlags::PathEllipsis | DrawTextFlags::NewsEllipsis)
63 mvLines.push_back(std::unique_ptr<ImplTextLineInfo>(pLine));
92 if ( !(nOrientation % 900_deg10) )
94 if ( nOrientation == 900_deg10 )
104 else if ( nOrientation == 1800_deg10 )
180 Point aBasePt( nBaseX, nBaseY );
234 pVDev->ImplInitTextColor();
238 rSalLayout.
DrawText( *pVDev->mpGraphics );
248 aPoint +=
Point( nX, nY );
254 bool bOldMap =
mbMap;
283 rSalLayout.
DrawBase().setX( w - 1 - x );
302 rSalLayout.
DrawBase().setX( nOldX );
325 Color aTextColor( aOldColor );
327 Color aTextLineColor( aOldTextLineColor );
328 Color aOverlineColor( aOldOverlineColor );
368 if ( aTextColor != aOldColor )
405 rSalLayout.
DrawBase() = aOrigPos + Point(+1,+1);
407 rSalLayout.
DrawBase() = aOrigPos + Point(-1,+0);
409 rSalLayout.
DrawBase() = aOrigPos + Point(-1,+1);
411 rSalLayout.
DrawBase() = aOrigPos + Point(+0,+1);
413 rSalLayout.
DrawBase() = aOrigPos + Point(+0,-1);
415 rSalLayout.
DrawBase() = aOrigPos + Point(+1,-1);
417 rSalLayout.
DrawBase() = aOrigPos + Point(+1,+0);
459 SAL_WARN_IF( nWidth <= 0,
"vcl",
"ImplGetTextLines: nWidth <= 0!" );
469 css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
474 css::uno::Reference<css::linguistic2::XLinguServiceManager2> xLinguMgr = css::linguistic2::LinguServiceManager::create(xContext);
475 xHyph = xLinguMgr->getHyphenator();
478 css::uno::Reference<css::i18n::XBreakIterator> xBI;
480 sal_Int32 nLen = rStr.getLength();
481 while ( nPos < nLen )
483 sal_Int32 nBreakPos = nPos;
485 while ( ( nBreakPos < nLen ) && ( rStr[ nBreakPos ] !=
'\r' ) && ( rStr[ nBreakPos ] !=
'\n' ) )
497 sal_Int32 nSoftBreak = _rLayout.
GetTextBreak( rStr, nWidth, nPos, nBreakPos - nPos );
498 if (nSoftBreak == -1)
502 SAL_WARN_IF( nSoftBreak >= nBreakPos,
"vcl",
"Break?!" );
503 css::i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, css::uno::Sequence <css::beans::PropertyValue>(), 1 );
504 css::i18n::LineBreakUserOptions aUserOptions;
505 css::i18n::LineBreakResults aLBR = xBI->getLineBreak( rStr, nSoftBreak, rDefLocale, nPos, aHyphOptions, aUserOptions );
506 nBreakPos = aLBR.breakIndex;
507 if ( nBreakPos <= nPos )
508 nBreakPos = nSoftBreak;
521 css::i18n::Boundary aBoundary = xBI->getWordBoundary( rStr, nBreakPos, rDefLocale, css::i18n::WordType::DICTIONARY_WORD,
true );
522 sal_Int32 nWordStart = nPos;
523 sal_Int32 nWordEnd = aBoundary.endPos;
524 SAL_WARN_IF( nWordEnd <= nWordStart, "vcl", "ImpBreakLine: Start >=
End?
" );
526 sal_Int32 nWordLen = nWordEnd - nWordStart;
527 if ( ( nWordEnd >= nSoftBreak ) && ( nWordLen > 3 ) )
529 // #104415# May happen, because getLineBreak may differ from getWordBoundary with DICTIONARY_WORD
530 // SAL_WARN_IF( nWordEnd < nMaxBreakPos, "vcl", "Hyph:
Break?
" );
531 OUString aWord = rStr.copy( nWordStart, nWordLen );
532 sal_Int32 nMinTrail = nWordEnd-nSoftBreak+1; //+1: Before the "broken off
" char
533 css::uno::Reference< css::linguistic2::XHyphenatedWord > xHyphWord;
535 xHyphWord = xHyph->hyphenate( aWord, rDefLocale, aWord.getLength() - nMinTrail, css::uno::Sequence< css::beans::PropertyValue >() );
538 bool bAlternate = xHyphWord->isAlternativeSpelling();
539 sal_Int32 _nWordLen = 1 + xHyphWord->getHyphenPos();
541 if ( ( _nWordLen >= 2 ) && ( (nWordStart+_nWordLen) >= 2 ) )
545 nBreakPos = nWordStart + _nWordLen;
549 OUString aAlt( xHyphWord->getHyphenatedWord() );
551 // We can have two cases:
552 // 1) "packen
" turns into "pak-ken
"
553 // 2) "Schiffahrt
" turns into "Schiff-fahrt
"
555 // In case 1 we need to replace a char
556 // In case 2 we add a char
558 // Correct recognition is made harder by words such as
559 // "Schiffahrtsbrennesseln
", as the Hyphenator splits all
560 // positions of the word and comes up with "Schifffahrtsbrennnesseln
"
561 // Thus, we cannot infer the aWord from the AlternativeWord's
563 // TODO: The whole junk will be made easier by a function in
564 // the Hyphenator, as soon as AMA adds it.
565 sal_Int32 nAltStart = _nWordLen - 1;
566 sal_Int32 nTxtStart = nAltStart - (aAlt.getLength() - aWord.getLength());
567 sal_Int32 nTxtEnd = nTxtStart;
568 sal_Int32 nAltEnd = nAltStart;
570 // The area between nStart and nEnd is the difference
571 // between AlternativeString and OriginalString
572 while( nTxtEnd < aWord.getLength() && nAltEnd < aAlt.getLength() &&
573 aWord[nTxtEnd] != aAlt[nAltEnd] )
579 // If a char was added, we notice it now:
580 if( nAltEnd > nTxtEnd && nAltStart == nAltEnd &&
581 aWord[ nTxtEnd ] == aAlt[nAltEnd] )
588 SAL_WARN_IF( ( nAltEnd - nAltStart ) != 1, "vcl", "Alternate: Wrong assumption!
" );
590 sal_Unicode cAlternateReplChar = 0;
591 if ( nTxtEnd > nTxtStart )
592 cAlternateReplChar = aAlt[ nAltStart ];
594 nBreakPos = nWordStart + nTxtStart;
595 if ( cAlternateReplChar )
603 nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
607 // fallback to something really simple
608 sal_Int32 nSpacePos = rStr.getLength();
612 nSpacePos = rStr.lastIndexOf( ' ', nSpacePos );
613 if( nSpacePos != -1 )
615 if( nSpacePos > nPos )
617 nW = _rLayout.GetTextWidth( rStr, nPos, nSpacePos-nPos );
619 } while( nW > nWidth );
621 if( nSpacePos != -1 )
623 nBreakPos = nSpacePos;
624 nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos );
625 if( nBreakPos < rStr.getLength()-1 )
631 if ( nLineWidth > nMaxLineWidth )
632 nMaxLineWidth = nLineWidth;
634 rLineInfo.AddLine( new ImplTextLineInfo( nLineWidth, nPos, nBreakPos-nPos ) );
636 if ( nBreakPos == nPos )
640 if ( nPos < nLen && ( ( rStr[ nPos ] == '\r' ) || ( rStr[ nPos ] == '\n' ) ) )
644 if ( ( nPos < nLen ) && ( rStr[ nPos ] == '\n' ) && ( rStr[ nPos-1 ] == '\r' ) )
650 for ( sal_Int32 nL = 0; nL < rLineInfo.Count(); nL++ )
652 ImplTextLineInfo* pLine = rLineInfo.GetLine( nL );
653 OUString aLine = rStr.copy( pLine->GetIndex(), pLine->GetLen() );
659 return nMaxLineWidth;
662 void OutputDevice::SetTextColor( const Color& rColor )
665 Color aColor( rColor );
667 if ( mnDrawMode & ( DrawModeFlags::BlackText | DrawModeFlags::WhiteText |
668 DrawModeFlags::GrayText |
669 DrawModeFlags::SettingsText ) )
671 if ( mnDrawMode & DrawModeFlags::BlackText )
673 else if ( mnDrawMode & DrawModeFlags::WhiteText )
675 else if ( mnDrawMode & DrawModeFlags::GrayText )
677 const sal_uInt8 cLum = aColor.GetLuminance();
678 aColor = Color( cLum, cLum, cLum );
680 else if ( mnDrawMode & DrawModeFlags::SettingsText )
681 aColor = GetSettings().GetStyleSettings().GetFontColor();
685 mpMetaFile->AddAction( new MetaTextColorAction( aColor ) );
687 if ( maTextColor != aColor )
689 maTextColor = aColor;
690 mbInitTextColor = true;
694 mpAlphaVDev->SetTextColor( COL_BLACK );
697 void OutputDevice::SetTextFillColor()
701 mpMetaFile->AddAction( new MetaTextFillColorAction( Color(), false ) );
703 if ( maFont.GetColor() != COL_TRANSPARENT ) {
704 maFont.SetFillColor( COL_TRANSPARENT );
706 if ( !maFont.IsTransparent() )
707 maFont.SetTransparent( true );
710 mpAlphaVDev->SetTextFillColor();
713 void OutputDevice::SetTextFillColor( const Color& rColor )
715 Color aColor( rColor );
716 bool bTransFill = aColor.IsTransparent();
720 if ( mnDrawMode & ( DrawModeFlags::BlackFill | DrawModeFlags::WhiteFill |
721 DrawModeFlags::GrayFill | DrawModeFlags::NoFill |
722 DrawModeFlags::SettingsFill ) )
724 if ( mnDrawMode & DrawModeFlags::BlackFill )
726 else if ( mnDrawMode & DrawModeFlags::WhiteFill )
728 else if ( mnDrawMode & DrawModeFlags::GrayFill )
730 const sal_uInt8 cLum = aColor.GetLuminance();
731 aColor = Color( cLum, cLum, cLum );
733 else if( mnDrawMode & DrawModeFlags::SettingsFill )
734 aColor = GetSettings().GetStyleSettings().GetWindowColor();
735 else if ( mnDrawMode & DrawModeFlags::NoFill )
737 aColor = COL_TRANSPARENT;
744 mpMetaFile->AddAction( new MetaTextFillColorAction( aColor, true ) );
746 if ( maFont.GetFillColor() != aColor )
747 maFont.SetFillColor( aColor );
748 if ( maFont.IsTransparent() != bTransFill )
749 maFont.SetTransparent( bTransFill );
752 mpAlphaVDev->SetTextFillColor( COL_BLACK );
755 Color OutputDevice::GetTextFillColor() const
757 if ( maFont.IsTransparent() )
758 return COL_TRANSPARENT;
760 return maFont.GetFillColor();
763 void OutputDevice::SetTextAlign( TextAlign eAlign )
767 mpMetaFile->AddAction( new MetaTextAlignAction( eAlign ) );
769 if ( maFont.GetAlignment() != eAlign )
771 maFont.SetAlignment( eAlign );
776 mpAlphaVDev->SetTextAlign( eAlign );
779 vcl::Region OutputDevice::GetOutputBoundsClipRegion() const
781 return GetClipRegion();
785 const SalLayoutFlags eDefaultLayout = SalLayoutFlags::NONE;
787 // ofz#23573 skip detecting bidi directions
788 const SalLayoutFlags eDefaultLayout = SalLayoutFlags::BiDiStrong;
791 void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr,
792 sal_Int32 nIndex, sal_Int32 nLen,
793 MetricVector* pVector, OUString* pDisplayText,
794 const SalLayoutGlyphs* pLayoutCache
797 assert(!is_double_buffered_window());
799 if( (nLen < 0) || (nIndex + nLen >= rStr.getLength()))
801 nLen = rStr.getLength() - nIndex;
804 if (mpOutDevData->mpRecordLayout)
806 pVector = &mpOutDevData->mpRecordLayout->m_aUnicodeBoundRects;
807 pDisplayText = &mpOutDevData->mpRecordLayout->m_aDisplayText;
810 #if OSL_DEBUG_LEVEL > 2
830 bool bInserted =
false;
831 for( MetricVector::const_iterator it = aTmp.begin(); it != aTmp.end(); ++it,
nIndex++ )
833 bool bAppend =
false;
837 else if( rStr[
nIndex ] ==
' ' && bInserted )
839 MetricVector::const_iterator next = it;
841 if( next != aTmp.end() && aClip.
IsOver( *next ) )
847 pVector->push_back( *it );
849 *pDisplayText += OUStringChar(rStr[
nIndex ]);
858 *pDisplayText += rStr.subView(
nIndex, nLen );
868 pLayoutCache =
nullptr;
870 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout(rStr, nIndex, nLen, rStartPt, 0,
nullptr,
eDefaultLayout,
nullptr, pLayoutCache);
886 nLen, pLayoutCache, pSalLayoutCache );
924 if( nLen < 0 || nIndex + nLen >= rStr.getLength() )
926 nLen = rStr.getLength() - nIndex;
940 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry, flags,
nullptr, pSalLayoutCache);
951 sal_Int32 nIndex, sal_Int32 nLen,
955 if( nIndex >= rStr.getLength() )
958 if( nLen < 0 || nIndex + nLen >= rStr.getLength() )
960 nLen = rStr.getLength() - nIndex;
964 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout(rStr, nIndex, nLen,
976 memset(pDXAry, 0, nLen *
sizeof(*pDXAry));
981 #if VCL_FLOAT_DEVICE_PIXEL
982 std::unique_ptr<DeviceCoordinate[]> pDXPixelArray;
988 int nWidthFactor = pSalLayout->GetUnitsPerPixel();
993 for(
int i = 1;
i < nLen; ++
i )
995 pDXPixelArray[
i ] += pDXPixelArray[
i-1 ];
1002 for(
int i = 0;
i < nLen; ++
i )
1009 if( nWidthFactor > 1 )
1013 for(
int i = 0;
i < nLen; ++
i )
1015 pDXPixelArray[
i] /= nWidthFactor;
1018 nWidth /= nWidthFactor;
1022 for(
int i = 0;
i < nLen; ++
i )
1031 tools::Long nWidth = pSalLayout->FillDXArray( pDXAry );
1032 int nWidthFactor = pSalLayout->GetUnitsPerPixel();
1036 for(
int i = 1;
i < nLen; ++
i )
1037 pDXAry[
i ] += pDXAry[
i-1 ];
1043 for(
int i = 0;
i < nLen; ++
i )
1048 if( nWidthFactor > 1 )
1051 for(
int i = 0;
i < nLen; ++
i )
1052 pDXAry[
i] /= nWidthFactor;
1053 nWidth /= nWidthFactor;
1060 sal_Int32 nIndex, sal_Int32 nLen,
1064 if( nIndex >= rStr.getLength() )
1066 if( nIndex+nLen >= rStr.getLength() )
1067 nLen = rStr.getLength() - nIndex;
1070 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout(rStr, nIndex, nLen,
Point(0, 0), 0,
nullptr,
1075 int nWidthFactor = pSalLayout->GetUnitsPerPixel();
1076 pSalLayout->GetCaretPositions( 2*nLen, pCaretXArray );
1081 for( i = 0; i < 2 * nLen; ++i )
1082 if( pCaretXArray[ i ] >= 0 )
1085 for( i = 0; i < 2 * nLen; ++i )
1087 if( pCaretXArray[ i ] >= 0 )
1088 nXPos = pCaretXArray[ i ];
1090 pCaretXArray[ i ] = nXPos;
1096 for( i = 0; i < 2 * nLen; ++i )
1097 pCaretXArray[i] = nWidth - pCaretXArray[i] - 1;
1103 for( i = 0; i < 2*nLen; ++i )
1107 if( nWidthFactor != 1 )
1109 for( i = 0; i < 2*nLen; ++i )
1110 pCaretXArray[i] /= nWidthFactor;
1115 const OUString& rStr,
1116 sal_Int32 nIndex, sal_Int32 nLen)
1120 if( (nLen < 0) || (nIndex + nLen >= rStr.getLength()))
1122 nLen = rStr.getLength() - nIndex;
1131 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout(rStr, nIndex, nLen, rStartPt, nWidth);
1142 const sal_Int32 nMinIndex,
const sal_Int32 nLen,
1151 sal_Int32 nEndIndex = rStr.getLength();
1152 if( nMinIndex + nLen < nEndIndex )
1153 nEndIndex = nMinIndex + nLen;
1156 if( nEndIndex < nMinIndex )
1157 nEndIndex = nMinIndex;
1166 bool bAllLtr =
true;
1167 for (sal_Int32
i = nMinIndex;
i < nEndIndex;
i++)
1172 if (rStr[
i] > 0x052F)
1195 std::optional<OUStringBuffer> xTmpStr;
1196 for( ; pStr < pEnd; ++pStr )
1199 if( (*pStr >=
'0') && (*pStr <=
'9') )
1203 if( cChar != *pStr )
1206 xTmpStr = OUStringBuffer(rStr);
1208 (*xTmpStr)[pStr - pBase] = cChar;
1213 rStr = (*xTmpStr).makeStringAndClear();
1217 bool bRightAlign = bool(
mnTextLayoutMode & ComplexTextLayoutFlags::BiDiRtl);
1219 bRightAlign =
false;
1225 bRightAlign ^= bRTLWindow;
1233 aLayoutArgs.SetOrientation( nOrientation );
1235 aLayoutArgs.SetLayoutWidth( nPixelWidth );
1236 aLayoutArgs.SetDXArray( pDXArray );
1242 sal_Int32 nMinIndex, sal_Int32 nLen,
1243 const Point& rLogicalPos,
tools::Long nLogicalWidth,
1248 if (pGlyphs && !pGlyphs->
IsValid())
1250 SAL_WARN(
"vcl",
"Trying to setup invalid cached glyphs - falling back to relayout!");
1258 if( -1 == nLen || nMinIndex + nLen > rOrigStr.getLength() )
1260 const sal_Int32 nNewLen = rOrigStr.getLength() - nMinIndex;
1266 OUString
aStr = rOrigStr;
1271 mpFontInstance->mpConversion->RecodeString( aStr, 0, aStr.getLength() );
1272 pLayoutCache =
nullptr;
1277 if( nLogicalWidth &&
mbMap )
1282 std::unique_ptr<DeviceCoordinate[]> xDXPixelArray;
1290 pDXPixelArray = xDXPixelArray.get();
1293 for(
int i = 0;
i < nLen; ++
i )
1300 #if VCL_FLOAT_DEVICE_PIXEL
1302 pDXPixelArray = xDXPixelArray.get();
1303 for(
int i = 0;
i < nLen; ++
i )
1305 pDXPixelArray[
i] = pDXArray[
i];
1314 nPixelWidth, pDXPixelArray, flags, pLayoutCache);
1320 if( pSalLayout && !pSalLayout->LayoutText( aLayoutArgs, pGlyphs ) )
1339 pSalLayout->AdjustLayout( aLayoutArgs );
1346 nRTLOffset = pDXPixelArray[ nLen - 1 ];
1347 else if( nPixelWidth )
1348 nRTLOffset = nPixelWidth;
1350 nRTLOffset = pSalLayout->GetTextWidth() / pSalLayout->GetUnitsPerPixel();
1351 pSalLayout->DrawOffset().setX( 1 - nRTLOffset );
1358 OUString
const& rString)
1365 OUString
aStr( rString );
1371 return (nCharPos != nIndex);
1375 sal_Int32 nIndex, sal_Int32 nLen,
1380 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout( rStr, nIndex, nLen,
1382 sal_Int32 nRetVal = -1;
1389 tools::Long nWidthFactor = pSalLayout->GetUnitsPerPixel();
1390 tools::Long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
1391 nTextWidth *= nWidthFactor * nSubPixelFactor;
1394 if( nCharExtra != 0 )
1396 nCharExtra *= nWidthFactor * nSubPixelFactor;
1399 nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor );
1407 sal_Int32 nIndex, sal_Int32 nLen,
1413 std::unique_ptr<SalLayout> pSalLayout =
ImplLayout( rStr, nIndex, nLen,
1415 sal_Int32 nRetVal = -1;
1422 tools::Long nWidthFactor = pSalLayout->GetUnitsPerPixel();
1423 tools::Long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
1425 nTextWidth *= nWidthFactor * nSubPixelFactor;
1428 if( nCharExtra != 0 )
1430 nCharExtra *= nWidthFactor * nSubPixelFactor;
1435 nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor );
1438 OUString aHyphenStr(nHyphenChar);
1439 std::unique_ptr<SalLayout> pHyphenLayout =
ImplLayout( aHyphenStr, 0, 1 );
1443 tools::Long nHyphenPixelWidth = pHyphenLayout->GetTextWidth() * nSubPixelFactor;
1446 nTextPixelWidth -= nHyphenPixelWidth;
1447 if( nExtraPixelWidth > 0 )
1448 nTextPixelWidth -= nExtraPixelWidth;
1450 rHyphenPos = pSalLayout->GetTextBreak(nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor);
1452 if( rHyphenPos > nRetVal )
1453 rHyphenPos = nRetVal;
1466 Color aOldTextColor;
1467 Color aOldTextFillColor;
1468 bool bRestoreFillColor =
false;
1471 bool bHighContrastBlack =
false;
1472 bool bHighContrastWhite =
false;
1474 if( rStyleSettings.GetHighContrastMode() )
1483 aCol = rStyleSettings.GetFaceColor();
1485 bHighContrastBlack = aCol.
IsDark();
1486 bHighContrastWhite = aCol.
IsBright();
1492 bRestoreFillColor =
true;
1495 if( bHighContrastBlack )
1497 else if( bHighContrastWhite )
1517 sal_Int32 nMnemonicPos = -1;
1519 OUString
aStr = rOrigStr;
1532 sal_Int32 nFormatLines;
1537 sal_Int32 nLines =
static_cast<sal_Int32
>(nHeight/nTextHeight);
1539 nFormatLines = aMultiLineInfo.
Count();
1542 if ( nFormatLines > nLines )
1547 nFormatLines = nLines-1;
1549 pLineInfo = aMultiLineInfo.
GetLine( nFormatLines );
1552 OUStringBuffer aLastLineBuffer(aLastLine);
1553 sal_Int32 nLastLineLen = aLastLineBuffer.getLength();
1554 for ( i = 0; i < nLastLineLen; i++ )
1556 if ( aLastLineBuffer[ i ] ==
'\n' )
1557 aLastLineBuffer[ i ] =
' ';
1559 aLastLine = aLastLineBuffer.makeStringAndClear();
1567 if ( nMaxTextWidth <= nWidth )
1572 if ( nFormatLines*nTextHeight > nHeight )
1576 if ( nStyle & DrawTextFlags::Clip )
1584 aPos.AdjustY(nHeight-(nFormatLines*nTextHeight) );
1586 aPos.AdjustY((nHeight-(nFormatLines*nTextHeight))/2 );
1590 aPos.AdjustY(nTextHeight );
1595 for ( i = 0; i < nFormatLines; i++ )
1597 pLineInfo = aMultiLineInfo.
GetLine( i );
1599 aPos.AdjustX(nWidth-pLineInfo->
GetWidth() );
1601 aPos.AdjustX((nWidth-pLineInfo->
GetWidth())/2 );
1603 sal_Int32 nLineLen = pLineInfo->
GetLen();
1604 _rLayout.
DrawText( aPos, aStr, nIndex, nLineLen, pVector, pDisplayText );
1605 if ( bDrawMnemonics )
1607 if ( (nMnemonicPos >= nIndex) && (nMnemonicPos < nIndex+nLineLen) )
1613 std::unique_ptr<tools::Long[]>
const pCaretXArray(
new tools::Long[2 * nLineLen]);
1616 tools::Long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
1617 tools::Long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
1626 aPos.AdjustY(nTextHeight );
1627 aPos.setX( rRect.
Left() );
1631 if ( !aLastLine.isEmpty() )
1632 _rLayout.
DrawText( aPos, aLastLine, 0, aLastLine.getLength(), pVector, pDisplayText );
1635 if ( nStyle & DrawTextFlags::Clip )
1636 rTargetDevice.
Pop();
1644 if ( nTextWidth > nWidth )
1651 nTextWidth = _rLayout.
GetTextWidth( aStr, 0, aStr.getLength() );
1656 if ( nTextHeight <= nHeight )
1662 aPos.AdjustX(nWidth-nTextWidth );
1664 aPos.AdjustX((nWidth-nTextWidth)/2 );
1668 aPos.AdjustY(nTextHeight );
1673 aPos.AdjustY(nHeight-nTextHeight );
1675 aPos.AdjustY((nHeight-nTextHeight)/2 );
1680 if ( nMnemonicPos != -1 )
1682 std::unique_ptr<tools::Long[]>
const pCaretXArray(
new tools::Long[2 * aStr.getLength()]);
1685 tools::Long lc_x2 = pCaretXArray[2*nMnemonicPos+1];
1693 if ( nStyle & DrawTextFlags::Clip )
1697 _rLayout.
DrawText( aPos, aStr, 0, aStr.getLength(), pVector, pDisplayText );
1698 if ( bDrawMnemonics && nMnemonicPos != -1 )
1700 rTargetDevice.
Pop();
1704 _rLayout.
DrawText( aPos, aStr, 0, aStr.getLength(), pVector, pDisplayText );
1705 if ( bDrawMnemonics && nMnemonicPos != -1 )
1710 if ( nStyle & DrawTextFlags::Disable && !pVector )
1713 if ( bRestoreFillColor )
1719 const OUString& rOrigStr,
1724 if ( rOrigStr.isEmpty() || rRect.
IsEmpty() )
1744 ImplDrawText( *
this, rRect, rOrigStr, nStyle,
nullptr,
nullptr, aLayout );
1759 pVector = &
mpOutDevData->mpRecordLayout->m_aUnicodeBoundRects;
1760 pDisplayText = &
mpOutDevData->mpRecordLayout->m_aDisplayText;
1764 if (
mpMetaFile && !bDecomposeTextRectAction )
1781 if ( !bDecomposeTextRectAction )
1787 ImplDrawText( *
this, rRect, rOrigStr, nStyle, pVector, pDisplayText, _pTextLayout ? *_pTextLayout : aDefaultLayout );
1808 OUString
aStr = rStr;
1816 sal_Int32 nFormatLines;
1821 ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, _pTextLayout ? *_pTextLayout : aDefaultLayout );
1822 nFormatLines = aMultiLineInfo.
Count();
1825 nLines =
static_cast<sal_uInt16
>(aRect.
GetHeight()/nTextHeight);
1830 if ( nFormatLines <= nLines )
1831 nLines = nFormatLines;
1835 nLines = nFormatLines;
1845 bool bMaxWidth = nMaxWidth == 0;
1847 for ( i = 0; i < nLines; i++ )
1849 pLineInfo = aMultiLineInfo.
GetLine( i );
1850 if ( bMaxWidth && (pLineInfo->
GetWidth() > nMaxWidth) )
1856 else if ( !nMaxWidth )
1858 for ( i = 0; i < nLines; i++ )
1860 pLineInfo = aMultiLineInfo.
GetLine( i );
1861 if ( pLineInfo->
GetWidth() > nMaxWidth )
1906 if (nStyle & DrawTextFlags::Right)
1935 OUString
aStr = rOrigStr;
1942 OUStringBuffer aTmpStr( aStr );
1944 sal_Int32 nEraseChars = std::max<sal_Int32>(4, aStr.getLength() - (nIndex*4)/3);
1945 while( nEraseChars < aStr.getLength() && _rLayout.
GetTextWidth( aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth )
1948 sal_Int32
i = (aTmpStr.getLength() - nEraseChars)/2;
1949 aTmpStr.remove(i, nEraseChars++);
1950 aTmpStr.insert(i,
"...");
1952 aStr = aTmpStr.makeStringAndClear();
1956 aStr = aStr.copy(0, nIndex);
1960 while ( !aStr.isEmpty() && (_rLayout.
GetTextWidth( aStr, 0, aStr.getLength() ) > nMaxWidth) )
1962 if ( (nIndex > 1) || (nIndex == aStr.getLength()) )
1964 aStr = aStr.replaceAt( nIndex, 1,
"");
1969 aStr += OUStringChar(rOrigStr[ 0 ]);
1973 OUString aPath( rOrigStr );
1974 OUString aAbbreviatedPath;
1975 osl_abbreviateSystemPath( aPath.pData, &aAbbreviatedPath.pData, nIndex,
nullptr );
1976 aStr = aAbbreviatedPath;
1980 static char const pSepChars[] =
".";
1982 sal_Int32 nLastContent = aStr.getLength();
1983 while ( nLastContent )
1989 while ( nLastContent &&
1993 OUString aLastStr = aStr.copy(nLastContent);
1994 OUString aTempLastStr1 =
"..." + aLastStr;
1995 if ( _rLayout.
GetTextWidth( aTempLastStr1, 0, aTempLastStr1.getLength() ) > nMaxWidth )
1999 sal_Int32 nFirstContent = 0;
2000 while ( nFirstContent < nLastContent )
2003 if (
ImplIsCharIn( aStr[ nFirstContent ], pSepChars ) )
2006 while ( (nFirstContent < nLastContent) &&
2010 if ( nFirstContent >= nLastContent )
2014 if ( nFirstContent > 4 )
2016 OUString aFirstStr = OUString::Concat(aStr.subView( 0, nFirstContent )) +
"...";
2017 OUString aTempStr = aFirstStr + aLastStr;
2018 if ( _rLayout.
GetTextWidth( aTempStr, 0, aTempStr.getLength() ) > nMaxWidth )
2025 if( nLastContent > aStr.getLength() )
2026 nLastContent = aStr.getLength();
2027 while ( nFirstContent < nLastContent )
2034 while ( (nFirstContent < nLastContent) &&
2038 if ( nFirstContent < nLastContent )
2040 OUString aTempLastStr = aStr.copy( nLastContent );
2041 aTempStr = aFirstStr + aTempLastStr;
2043 if ( _rLayout.
GetTextWidth( aTempStr, 0, aTempStr.getLength() ) > nMaxWidth )
2047 while ( nFirstContent < nLastContent );
2058 sal_Int32 nIndex, sal_Int32 nLen,
2064 if( (nLen < 0) || (nIndex + nLen >= rStr.getLength()))
2066 nLen = rStr.getLength() - nIndex;
2081 if( nIndex >= rStr.getLength() )
2084 if( (nLen < 0) || (nIndex + nLen >= rStr.getLength()))
2086 nLen = rStr.getLength() - nIndex;
2088 OUString
aStr = rStr;
2089 sal_Int32 nMnemonicPos = -1;
2097 if ( nMnemonicPos != -1 )
2099 if( nMnemonicPos < nIndex )
2105 if( nMnemonicPos < (nIndex+nLen) )
2107 SAL_WARN_IF( nMnemonicPos >= (nIndex+nLen),
"vcl",
"Mnemonic underline marker after last character" );
2109 bool bInvalidPos =
false;
2111 if( nMnemonicPos >= nLen )
2117 nMnemonicPos = nLen-1;
2120 std::unique_ptr<tools::Long[]>
const pCaretXArray(
new tools::Long[2 * nLen]);
2122 tools::Long lc_x1 = pCaretXArray[ 2*(nMnemonicPos - nIndex) ];
2123 tools::Long lc_x2 = pCaretXArray[ 2*(nMnemonicPos - nIndex)+1 ];
2124 nMnemonicWidth = ::abs(static_cast<int>(lc_x1 - lc_x2));
2141 Color aOldTextColor;
2142 Color aOldTextFillColor;
2143 bool bRestoreFillColor;
2144 bool bHighContrastBlack =
false;
2145 bool bHighContrastWhite =
false;
2153 bHighContrastBlack = aCol.
IsDark();
2154 bHighContrastWhite = aCol.
IsBright();
2161 bRestoreFillColor =
true;
2165 bRestoreFillColor =
false;
2167 if( bHighContrastBlack )
2169 else if( bHighContrastWhite )
2174 DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
2178 if ( nMnemonicPos != -1 )
2182 if ( bRestoreFillColor )
2187 DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText, pGlyphs );
2191 if ( nMnemonicPos != -1 )
2202 sal_Int32 nLen = rStr.getLength();
2205 sal_Int32 nMnemonicPos;
2207 if ( nMnemonicPos != -1 )
2209 if ( nMnemonicPos < nIndex )
2211 else if (static_cast<sal_uLong>(nMnemonicPos) < static_cast<sal_uLong>(nIndex+nLen))
2214 return GetTextWidth( aStr, nIndex, nLen,
nullptr, pGlyphs );
2219 OUString
aStr = rStr;
2220 sal_Int32 nLen = aStr.getLength();
2226 if ( aStr[ i ] ==
'~' )
2231 if ( aStr[ i+1 ] !=
'~' )
2233 if ( rMnemonicPos == -1 )
2235 aStr = aStr.replaceAt( i, 1,
"" );
2240 aStr = aStr.replaceAt( i, 1,
"" );
2253 const OUString& rStr, sal_Int32 nBase,
2254 sal_Int32 nIndex, sal_Int32 nLen,
2261 std::unique_ptr<SalLayout> pSalLayout;
2265 if( nBase != nIndex )
2267 sal_Int32 nStart = std::min( nBase, nIndex );
2268 sal_Int32 nOfsLen = std::max( nBase, nIndex ) - nStart;
2269 pSalLayout =
ImplLayout( rStr, nStart, nOfsLen, aPoint, nLayoutWidth, pDXAry );
2272 nXOffset = pSalLayout->GetTextWidth();
2273 nXOffset /= pSalLayout->GetUnitsPerPixel();
2276 nXOffset = -nXOffset;
2285 bRet = pSalLayout->GetBoundRect(aPixelRect);
2289 int nWidthFactor = pSalLayout->GetUnitsPerPixel();
2291 if( nWidthFactor > 1 )
2293 double fFactor = 1.0 / nWidthFactor;
2295 static_cast< tools::Long >(aPixelRect.
Left() * fFactor) );
2297 static_cast< tools::Long >(aPixelRect.
Right() * fFactor) );
2299 static_cast< tools::Long >(aPixelRect.
Top() * fFactor) );
2301 static_cast< tools::Long >(aPixelRect.
Bottom() * fFactor) );
2305 aRotatedOfs -= pSalLayout->GetDrawPosition(
Point( nXOffset, 0 ) );
2306 aPixelRect += aRotatedOfs;
2317 const OUString& rStr, sal_Int32 nBase,
2318 sal_Int32 nIndex, sal_Int32 nLen,
2328 nLen = rStr.getLength() - nIndex;
2330 rVector.reserve( nLen );
2334 bool bOldMap =
mbMap;
2341 std::unique_ptr<SalLayout> pSalLayout;
2345 if( nBase != nIndex )
2347 sal_Int32 nStart = std::min( nBase, nIndex );
2348 sal_Int32 nOfsLen = std::max( nBase, nIndex ) - nStart;
2349 pSalLayout =
ImplLayout( rStr, nStart, nOfsLen,
Point(0,0), nLayoutWidth, pDXArray );
2352 nXOffset = pSalLayout->GetTextWidth();
2356 nXOffset = -nXOffset;
2360 pSalLayout =
ImplLayout( rStr, nIndex, nLen,
Point(0,0), nLayoutWidth, pDXArray );
2363 bRet = pSalLayout->GetOutline(rVector);
2369 int nWidthFactor = pSalLayout->GetUnitsPerPixel();
2373 aRotatedOfs -= pSalLayout->GetDrawPosition(
Point( nXOffset, 0 ) );
2374 aMatrix.
translate( aRotatedOfs.X(), aRotatedOfs.Y() );
2377 if( nWidthFactor > 1 )
2379 double fFactor = 1.0 / nWidthFactor;
2380 aMatrix.
scale( fFactor, fFactor );
2385 for (
auto & elem : rVector)
2386 elem.transform( aMatrix );
2404 const OUString& rStr, sal_Int32 nBase,
2405 sal_Int32 nIndex, sal_Int32 nLen,
2408 rResultVector.clear();
2413 nLayoutWidth, pDXArray ) )
2417 rResultVector.reserve( aB2DPolyPolyVector.size() );
2418 for (
auto const& elem : aB2DPolyPolyVector)
2419 rResultVector.emplace_back(elem);
2435 for (
auto const& elem : aB2DPolyPolyVector)
2436 for(
auto const& rB2DPolygon : elem)
SAL_DLLPRIVATE std::unique_ptr< SalLayout > ImplGlyphFallbackLayout(std::unique_ptr< SalLayout >, ImplLayoutArgs &) const
void EnableOutput(bool bEnable=true)
const Color & GetTextColor() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
SAL_DLLPRIVATE float approximate_char_width() const
SAL_DLLPRIVATE DeviceCoordinate LogicWidthToDeviceCoordinate(tools::Long nWidth) const
const Wallpaper & GetBackground() const
void SetFontSize(const Size &)
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
ImplTextLineInfo * GetLine(sal_Int32 nLine) const
tools::Long mnTextOffX
font specific text alignment offsets in pixel units
int GetUnitsPerPixel() const
std::vector< tools::Rectangle > MetricVector
virtual vcl::Region GetOutputBoundsClipRegion() const
std::vector< std::unique_ptr< ImplTextLineInfo > > mvLines
virtual bool IsVirtual() const
bool GetNextPos(int *nCharPos, bool *bRTL)
const Color & GetTextLineColor() const
void DrawCtrlText(const Point &rPos, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, DrawTextFlags nStyle=DrawTextFlags::Mnemonic, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr)
FontLineStyle GetOverline() const
bool IsBackground() const
const StyleSettings & GetStyleSettings() const
TextAlign GetTextAlign() const
static const AllSettings & GetSettings()
Gets the application's settings.
static SAL_DLLPRIVATE OUString ImplGetEllipsisString(const OutputDevice &rTargetDevice, const OUString &rStr, tools::Long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout &_rLayout)
bool IsOutputEnabled() const
const SalLayoutFlags eDefaultLayout
sal_Int32 GetTextBreak(const OUString &rStr, tools::Long nTextWidth, sal_Int32 nIndex, sal_Int32 nLen=-1, tools::Long nCharExtra=0, vcl::TextLayoutCache const *=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
tools::Long GetOutOffXPixel() const
virtual DeviceCoordinate GetTextWidth() const
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
SAL_DLLPRIVATE void ImplInitTextColor()
SAL_DLLPRIVATE bool is_double_buffered_window() const
void IntersectClipRegion(const tools::Rectangle &rRect)
static bool ImplIsCharIn(sal_Unicode c, const char *pStr)
SAL_DLLPRIVATE void ImplDrawSpecialText(SalLayout &)
constexpr::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
void EnableMapMode(bool bEnable=true)
void DrawMask(const Point &rDestPt, const Bitmap &rBitmap, const Color &rMaskColor)
virtual bool DecomposeTextRectAction() const =0
bool IsOver(const tools::Rectangle &rRect) const
tools::Long mnEmphasisDescent
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel)=0
tools::Rectangle ImplGetTextBoundRect(const SalLayout &)
void DrawTextArray(const Point &rStartPt, const OUString &rStr, const tools::Long *pDXAry, sal_Int32 nIndex=0, sal_Int32 nLen=-1, SalLayoutFlags flags=SalLayoutFlags::NONE, const SalLayoutGlyphs *pLayoutCache=nullptr)
void NeedFallback(int nMinRunPos, int nEndRunPos, bool bRTL)
const Color & GetOverlineColor() const
void ImplDrawTextBackground(const SalLayout &)
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Color GetTextFillColor() const
static SAL_DLLPRIVATE tools::Long ImplGetTextLines(ImplMultiTextLineInfo &rLineInfo, tools::Long nWidth, const OUString &rStr, DrawTextFlags nStyle, const vcl::ITextLayout &_rLayout)
void DrawStretchText(const Point &rStartPt, sal_uLong nWidth, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1)
FontKerning GetKerning() const
tools::Long GetAscent() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
is an implementation of the ITextLayout interface which simply delegates its calls to the respective ...
const vcl::Font & GetFont() const
OUString GetEllipsisString(const OUString &rStr, tools::Long nMaxWidth, DrawTextFlags nStyle=DrawTextFlags::EndEllipsis) const
bool GetTextOutline(tools::PolyPolygon &, const OUString &rStr) const
bool GetHighContrastMode() const
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
const LanguageTag & GetLanguageTag() const
FontMetric GetFontMetric() const
tools::Long GetCtrlTextWidth(const OUString &rStr, const SalLayoutGlyphs *pLayoutCache=nullptr) const
sal_Int32 GetIndex() const
static std::shared_ptr< vcl::TextLayoutCache > CreateTextLayoutCache(OUString const &)
tools::Long GetWidth() const
B2IRange fround(const B2DRange &rRange)
bool GetBoundRect(tools::Rectangle &) const
FontEmphasisMark GetEmphasisMark() const
SAL_DLLPRIVATE void ImplDrawMnemonicLine(tools::Long nX, tools::Long nY, tools::Long nWidth)
bool GetTextOutlines(PolyPolyVector &, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, const tools::Long *pDXArray=nullptr) const
SalGraphics * mpGraphics
Graphics context to draw on.
bool IsTextFillColor() const
void DrawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice &rOutDev)
virtual void SetFillColor()=0
ImplSVData * ImplGetSVData()
const Color & GetDisableColor() const
bool IsRTLEnabled() const
static std::shared_ptr< vcl::TextLayoutCache > CreateTextLayoutCache(OUString const &)
bool Rotate(Degree10 nAngle10, const Color &rFillColor)
Rotate bitmap by the specified angle.
virtual void SetLineColor()=0
float approximate_digit_width() const
virtual void DrawText(SalGraphics &) const =0
void SetOrientation(Degree10 nLineOrientation)
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
SAL_DLLPRIVATE void ImplDrawTextDirect(SalLayout &, bool bTextLines)
const Color & GetColor() const
bool IsWordLineMode() const
virtual bool HasMirroredGraphics() const
void AddLine(ImplTextLineInfo *pLine)
SAL_DLLPRIVATE void ImplDrawTextRect(tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel(tools::Long nWidth) const
Convert a logical width to a width in units of device pixels.
void SetTextColor(const Color &rColor)
void scale(double fX, double fY)
tools::Long DeviceCoordinate
std::vector< tools::PolyPolygon > PolyPolyVector
void Intersect(const tools::Rectangle &rRegion)
Point GetDrawPosition(const Point &rRelative=Point(0, 0)) const
virtual tools::Long GetGraphicsWidth() const =0
bool ImplDrawRotateText(SalLayout &)
FontStrikeout GetStrikeout() const
virtual tools::Long GetTextWidth(const OUString &_rText, sal_Int32 _nStartIndex, sal_Int32 _nLength) const =0
const AllSettings & GetSettings() const
tools::Long mnEmphasisAscent
std::unique_ptr< SalLayout > ImplLayout(const OUString &, sal_Int32 nIndex, sal_Int32 nLen, const Point &rLogicPos=Point(0, 0), tools::Long nLogicWidth=0, const tools::Long *pLogicDXArray=nullptr, SalLayoutFlags flags=SalLayoutFlags::NONE, vcl::TextLayoutCache const *=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
tools::Long GetOutOffYPixel() const
StyleSettingsOptions GetOptions() const
#define TEXT_DRAW_ELLIPSIS
bool GetGlyphBoundRects(const Point &rOrigin, const OUString &rStr, int nIndex, int nLen, MetricVector &rVector)
bool IsUnderlineAbove() const
virtual sal_Int32 GetTextBreak(const OUString &_rText, tools::Long _nMaxTextWidth, sal_Int32 _nStartIndex, sal_Int32 _nLength) const =0
void GetCaretPositions(const OUString &, tools::Long *pCaretXArray, sal_Int32 nIndex, sal_Int32 nLen, const SalLayoutGlyphs *pGlyphs=nullptr) const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
const LanguageTag & getLocale()
FontRelief GetRelief() const
SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs(OUString &, const sal_Int32 nIndex, const sal_Int32 nLen, DeviceCoordinate nPixelWidth, const DeviceCoordinate *pPixelDXArray, SalLayoutFlags flags=SalLayoutFlags::NONE, vcl::TextLayoutCache const *=nullptr) const
VclPtr< VirtualDevice > mpAlphaVDev
#define SAL_WARN_IF(condition, area, stream)
constexpr::Color COL_GREEN(0x00, 0x80, 0x00)
void SetFont(const vcl::Font &rNewFont)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
static void ImplDrawText(OutputDevice &rTargetDevice, const tools::Rectangle &rRect, const OUString &rOrigStr, DrawTextFlags nStyle, MetricVector *pVector, OUString *pDisplayText, vcl::ITextLayout &_rLayout)
SAL_DLLPRIVATE void ImplDrawEmphasisMarks(SalLayout &)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_LIGHTGREEN
virtual void GetCaretPositions(const OUString &_rText, tools::Long *_pCaretXArray, sal_Int32 _nStartIndex, sal_Int32 _nLength) const =0
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
sal_UCS4 GetLocalizedChar(sal_UCS4 nChar, LanguageType eLang)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
virtual void InitClipRegion()
Reference< XComponentContext > getProcessComponentContext()
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
bool GetTextIsRTL(const OUString &, sal_Int32 nIndex, sal_Int32 nLen) const
rtl::Reference< LogicalFontInstance > mpFontInstance
void translate(double fX, double fY)
void AddTextRectActions(const tools::Rectangle &rRect, const OUString &rOrigStr, DrawTextFlags nStyle, GDIMetaFile &rMtf)
Generate MetaTextActions for the text rect.
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, const tools::Long *pDXArray=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
Return the exact bounding rectangle of rStr.
SAL_DLLPRIVATE tools::Rectangle ImplLogicToDevicePixel(const tools::Rectangle &rLogicRect) const
Convert a logical rectangle to a rectangle in physical device pixel units.
FontLineStyle GetUnderline() const
ComplexTextLayoutFlags mnTextLayoutMode
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames) ...
#define SAL_WARN(area, stream)
std::unique_ptr< ImplOutDevData > mpOutDevData
#define DBG_TESTSOLARMUTEX()
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
virtual void DrawText(const Point &_rStartPoint, const OUString &_rText, sal_Int32 _nStartIndex, sal_Int32 _nLength, MetricVector *_pVector, OUString *_pDisplayText)=0
VCL_DLLPUBLIC css::uno::Reference< css::i18n::XBreakIterator > CreateBreakIterator()
SAL_DLLPRIVATE tools::Long ImplDevicePixelToLogicWidth(tools::Long nWidth) const
Convert device pixels to a width in logical units.
static OUString GetNonMnemonicString(const OUString &rStr, sal_Int32 &rMnemonicPos)
void ImplDrawTextLines(SalLayout &, FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline, bool bWordLine, bool bUnderlineAbove)
bool IsDeviceOutputNecessary() const
void Push(PushFlags nFlags=PushFlags::ALL)
virtual void SetTextColor(Color nColor)=0
tools::Long GetTextArray(const OUString &rStr, tools::Long *pDXAry, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
SAL_DLLPRIVATE tools::Long ImplDevicePixelToLogicHeight(tools::Long nHeight) const
Convert device pixels to a height in logical units.
SAL_DLLPRIVATE void ImplDrawPolygon(const tools::Polygon &rPoly, const tools::PolyPolygon *pClipPolyPoly=nullptr)
::std::vector< B2DPolyPolygon > B2DPolyPolygonVector
SAL_DLLPRIVATE bool InitFont() const
LanguageType meTextLanguage