summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-11-08 12:52:51 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2013-11-08 13:02:21 +0400
commit560b27613679d2a3b3ddb89c2afe481bcf2996e3 (patch)
tree653c950099dafae14d142fff9ed2239ed55ae860
parent5ecd8a55ee494c1150ec552a9002c6991371437c (diff)
fdo#71306: fix printing from basic ide
regression from e13a3d566ecc34a46e037aca1b2d70e58501e422 Change-Id: I0d734e112038746aa48df669d4b82b644a95c220
-rw-r--r--basctl/source/basicide/baside2.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 708037146b90..0acfe05e5380 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -910,7 +910,9 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
sal_uInt16 nLines = aLine.getLength()/nCharspLine+1;
for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
{
- OUString aTmpLine = aLine.copy(nLine*nCharspLine, nCharspLine );
+ sal_Int32 nBeginIndex = nLine*nCharspLine;
+ sal_Int32 nCopyCount = std::min<sal_Int32>(nCharspLine, aLine.getLength()-nBeginIndex);
+ OUString aTmpLine = aLine.copy(nBeginIndex, nCopyCount);
aPos.Y() += nLineHeight;
if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) )
{