diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-13 16:45:25 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-09-14 22:40:32 +0200 |
commit | b5e214f27c5fc8911e131597c628d5062aa056a1 (patch) | |
tree | 20a3269d4c288762a4db0df7240b6d6314f1ea42 /sw | |
parent | f50c547e22e0793061c5123cccb8c292e57de470 (diff) |
Avoid getTokenCount in SwAddressPreview::DrawText_Impl
Change-Id: I28c678d0d3db4cbea6c15141d1d0157447cd4db7
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/dbui/mailmergehelper.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 79113f103fbe..2f916785919b 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -34,7 +34,6 @@ #include <com/sun/star/mail/MailServiceProvider.hpp> #include <com/sun/star/mail/XSmtpService.hpp> #include <comphelper/processfactory.hxx> -#include <comphelper/string.hxx> #include <vcl/msgbox.hxx> #include <vcl/settings.hxx> #include <vcl/builderfactory.hxx> @@ -449,16 +448,16 @@ void SwAddressPreview::DrawText_Impl(vcl::RenderContext& rRenderContext, const O rRenderContext.DrawRect(Rectangle(rTopLeft, rSize)); } sal_Int32 nHeight = GetTextHeight(); - OUString sAddress(rAddress); - sal_uInt16 nTokens = comphelper::string::getTokenCount(sAddress, '\n'); Point aStart = rTopLeft; //put it away from the border aStart.Move(2, 2); - for (sal_uInt16 nToken = 0; nToken < nTokens; nToken++) + sal_Int32 nPos = 0; + do { - rRenderContext.DrawText(aStart, sAddress.getToken(nToken, '\n')); + rRenderContext.DrawText(aStart, rAddress.getToken(0, '\n', nPos)); aStart.Y() += nHeight; } + while (nPos >= 0); } OUString SwAddressPreview::FillData( |