summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tools/gen.hxx5
-rw-r--r--sw/source/core/crsr/viscrs.cxx17
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx7
-rw-r--r--tools/source/generic/gen.cxx7
4 files changed, 20 insertions, 16 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index e8ad8feeae8b..b17cb196dd87 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -27,6 +27,10 @@
#include <cstdlib>
class SvStream;
+namespace rtl
+{
+ class OString;
+}
enum TriState { TRISTATE_FALSE, TRISTATE_TRUE, TRISTATE_INDET };
@@ -436,6 +440,7 @@ public:
void setY( long n ) { nBottom += n-nTop; nTop = n; }
void setWidth( long n ) { nRight = nLeft + n; }
void setHeight( long n ) { nBottom = nTop + n; }
+ rtl::OString toString() const;
private:
long nLeft;
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 8ad7b07f4602..cf68b8d98d0a 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -179,9 +179,8 @@ void SwVisCrsr::_SetPosAndShow()
if (m_pCrsrShell->isTiledRendering())
{
- std::stringstream ss;
- ss << aRect.Width() << ", " << aRect.Height() << ", " << aRect.Left() << ", " << aRect.Top();
- OString sRect = ss.str().c_str();
+ Rectangle aSVRect(aRect.Pos().getX(), aRect.Pos().getY(), aRect.Pos().getX() + aRect.SSize().Width(), aRect.Pos().getY() + aRect.SSize().Height());
+ OString sRect = aSVRect.toString();
m_pCrsrShell->libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
}
@@ -347,13 +346,11 @@ void SwSelPaintRects::Show()
// client side.
const SwShellCrsr* pCursor = GetShell()->getShellCrsr(false);
SwRect aStartRect = lcl_getLayoutRect(pCursor->GetSttPos(), *pCursor->Start());
- std::stringstream ss;
- ss << aStartRect.Width() << ", " << aStartRect.Height() << ", " << aStartRect.Left() << ", " << aStartRect.Top();
- GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, ss.str().c_str());
+ OString sRect = aStartRect.SVRect().toString();
+ GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, sRect.getStr());
SwRect aEndRect = lcl_getLayoutRect(pCursor->GetEndPos(), *pCursor->End());
- ss.str("");
- ss << aEndRect.Width() << ", " << aEndRect.Height() << ", " << aEndRect.Left() << ", " << aEndRect.Top();
- GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, ss.str().c_str());
+ sRect = aEndRect.SVRect().toString();
+ GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, sRect.getStr());
}
std::stringstream ss;
@@ -362,7 +359,7 @@ void SwSelPaintRects::Show()
const SwRect& rRect = (*this)[i];
if (i)
ss << "; ";
- ss << rRect.Width() << ", " << rRect.Height() << ", " << rRect.Left() << ", " << rRect.Top();
+ ss << rRect.SVRect().toString().getStr();
}
OString sRect = ss.str().c_str();
GetShell()->libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION, sRect.getStr());
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 9b641cf4c15d..c8565d49646d 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6234,12 +6234,7 @@ void SwEditWin::LogicInvalidate(const vcl::Region* pRegion)
if (!pRegion)
sRectangle = "EMPTY";
else
- {
- std::stringstream ss;
- Rectangle aRectangle = pRegion->GetBoundRect();
- ss << aRectangle.getWidth() << ", " << aRectangle.getHeight() << ", " << aRectangle.getX() << ", " << aRectangle.getY();
- sRectangle = ss.str().c_str();
- }
+ sRectangle = pRegion->GetBoundRect().toString();
m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
}
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index cc64f8fb3465..e2a61c5f56a8 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -195,4 +195,11 @@ SvStream& WriteRectangle( SvStream& rOStream, const Rectangle& rRect )
return rOStream;
}
+OString Rectangle::toString() const
+{
+ std::stringstream ss;
+ ss << getWidth() << ", " << getHeight() << ", " << getX() << ", " << getY();
+ return ss.str().c_str();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */