29 #include <com/sun/star/accessibility/AccessibleTextType.hpp>
30 #include <com/sun/star/container/XEnumerationAccess.hpp>
31 #include <com/sun/star/i18n/BreakIterator.hpp>
32 #include <com/sun/star/i18n/CharacterIteratorMode.hpp>
33 #include <com/sun/star/i18n/ScriptDirection.hpp>
34 #include <com/sun/star/i18n/WordType.hpp>
35 #include <com/sun/star/rendering/CompositeOperation.hpp>
36 #include <com/sun/star/rendering/TextDirection.hpp>
37 #include <com/sun/star/text/WritingMode2.hpp>
50 sal_Int32 Signum (
const sal_Int32
nValue)
67 const Reference<rendering::XCanvas>& rxCanvas,
68 const ::std::function<
void (
const css::awt::Rectangle&)>& rInvalidator)
71 mxScriptTypeDetector(),
78 [this] (sal_Int32 const nParagraphIndex, sal_Int32 const nCharacterIndex)
79 {
return this->GetCaretBounds(nParagraphIndex, nCharacterIndex); },
83 mbIsFormatPending(
false),
84 maTextChangeBroadcaster()
86 Reference<lang::XMultiComponentFactory>
xFactory =
87 rxContext->getServiceManager();
92 mxBreakIterator = i18n::BreakIterator::create(rxContext);
96 mxScriptTypeDetector.set(
97 xFactory->createInstanceWithContext(
98 "com.sun.star.i18n.ScriptTypeDetector",
103 void PresenterTextView::SetText (
const Reference<text::XText>& rxText)
105 maParagraphs.clear();
107 Reference<container::XEnumerationAccess> xParagraphAccess (rxText, UNO_QUERY);
108 if ( ! xParagraphAccess.is())
111 Reference<container::XEnumeration> xParagraphs =
112 xParagraphAccess->createEnumeration();
113 if ( ! xParagraphs.is())
119 sal_Int32 nCharacterCount (0);
120 while (xParagraphs->hasMoreElements())
125 mxScriptTypeDetector,
126 Reference<text::XTextRange>(xParagraphs->nextElement(), UNO_QUERY),
128 pParagraph->SetupCellArray(
mpFont);
129 pParagraph->SetCharacterOffset(nCharacterCount);
130 nCharacterCount += pParagraph->GetCharacterCount();
131 maParagraphs.push_back(pParagraph);
135 mpCaret->HideCaret();
140 void PresenterTextView::SetTextChangeBroadcaster (
141 const ::std::function<
void ()>& rBroadcaster)
143 maTextChangeBroadcaster = rBroadcaster;
146 void PresenterTextView::SetLocation (
const css::geometry::RealPoint2D& rLocation)
150 for (
auto& rxParagraph : maParagraphs)
152 rxParagraph->SetOrigin(
158 void PresenterTextView::SetSize (
const css::geometry::RealSize2D& rSize)
164 double PresenterTextView::GetTotalTextHeight()
166 if (mbIsFormatPending)
173 return std::accumulate(maParagraphs.begin(), maParagraphs.end(), double(0),
175 return nTotalHeight + rxParagraph->GetTotalTextHeight();
185 void PresenterTextView::SetOffset(
189 mnLeftOffset = nLeft;
196 void PresenterTextView::MoveCaret (
197 const sal_Int32 nDistance,
198 const sal_Int16 nTextType)
205 if (mpCaret->GetParagraphIndex() < 0)
207 mpCaret->SetPosition(0,0);
211 sal_Int32 nParagraphIndex (mpCaret->GetParagraphIndex());
212 sal_Int32 nCharacterIndex (mpCaret->GetCharacterIndex());
216 case AccessibleTextType::CHARACTER:
217 nCharacterIndex += nDistance;
220 case AccessibleTextType::WORD:
222 sal_Int32 nRemainingDistance (nDistance);
223 while (nRemainingDistance != 0)
228 const sal_Int32 nDelta (Signum(nDistance));
229 nCharacterIndex = pParagraph->GetWordBoundary(nCharacterIndex, nDelta);
230 if (nCharacterIndex < 0)
233 nParagraphIndex += nDelta;
234 if (nParagraphIndex < 0)
238 nRemainingDistance = 0;
242 nParagraphIndex = maParagraphs.size()-1;
243 pParagraph = GetParagraph(nParagraphIndex);
245 nCharacterIndex = pParagraph->GetCharacterCount();
246 nRemainingDistance = 0;
250 nRemainingDistance -= nDelta;
254 pParagraph = GetParagraph(nParagraphIndex);
258 nCharacterIndex = pParagraph->GetCharacterCount();
265 nRemainingDistance -= nDelta;
275 mpCaret->SetPosition(nParagraphIndex, nCharacterIndex);
278 void PresenterTextView::Paint (
279 const css::awt::Rectangle& rUpdateBox)
286 if (mbIsFormatPending)
293 const sal_Int32 nAdditionalLeftBorder (10);
294 const sal_Int32 nAdditionalRightBorder (5);
297 const sal_Int32 nClipLeft (::std::max(
298 PresenterGeometryHelper::Round(
maLocation.X)-nAdditionalLeftBorder, rUpdateBox.X));
299 const sal_Int32 nClipTop (::std::max(
300 PresenterGeometryHelper::Round(
maLocation.Y), rUpdateBox.Y));
301 const sal_Int32 nClipRight (::std::min(
302 PresenterGeometryHelper::Round(
maLocation.X+
maSize.Width)+nAdditionalRightBorder, rUpdateBox.X+rUpdateBox.Width));
303 const sal_Int32 nClipBottom (::std::min(
304 PresenterGeometryHelper::Round(
maLocation.Y+
maSize.Height), rUpdateBox.Y+rUpdateBox.Height));
305 if (nClipLeft>=nClipRight || nClipTop>=nClipBottom)
308 const awt::Rectangle aClipBox(
311 nClipRight - nClipLeft,
312 nClipBottom - nClipTop);
313 Reference<rendering::XPolyPolygon2D> xClipPolygon (
314 PresenterGeometryHelper::CreatePolygon(aClipBox,
mxCanvas->getDevice()));
316 const rendering::ViewState aViewState(
317 geometry::AffineMatrix2D(1,0,0, 0,1,0),
320 rendering::RenderState aRenderState (
321 geometry::AffineMatrix2D(1,0,nX, 0,1,nY),
324 rendering::CompositeOperation::SOURCE);
325 PresenterCanvasHelper::SetDeviceColor(aRenderState,
mpFont->mnColor);
327 for (
const auto& rxParagraph : maParagraphs)
340 aRenderState.AffineTransform.m02 = 0;
341 aRenderState.AffineTransform.m12 = 0;
343 #ifdef SHOW_CHARACTER_BOXES
344 PresenterCanvasHelper::SetDeviceColor(aRenderState, 0x00808080);
345 for (sal_Int32 nParagraphIndex(0), nParagraphCount(GetParagraphCount());
346 nParagraphIndex<nParagraphCount;
352 for (sal_Int32 nCharacterIndex(0),nCharacterCount(pParagraph->GetCharacterCount());
353 nCharacterIndex<nCharacterCount; ++nCharacterIndex)
355 const awt::Rectangle aBox (pParagraph->GetCharacterBounds(nCharacterIndex,
false));
357 PresenterGeometryHelper::CreatePolygon(
364 PresenterCanvasHelper::SetDeviceColor(aRenderState,
mpFont->mnColor);
367 if (mpCaret && mpCaret->IsVisible())
370 PresenterGeometryHelper::CreatePolygon(
371 mpCaret->GetBounds(),
383 awt::Rectangle PresenterTextView::GetCaretBounds (
384 sal_Int32 nParagraphIndex,
385 const sal_Int32 nCharacterIndex)
const
390 return pParagraph->GetCharacterBounds(nCharacterIndex,
true);
392 return awt::Rectangle(0,0,0,0);
397 void PresenterTextView::RequestFormat()
399 mbIsFormatPending =
true;
402 void PresenterTextView::Format()
404 mbIsFormatPending =
false;
407 for (
const auto& rxParagraph : maParagraphs)
410 nY += rxParagraph->GetTotalTextHeight();
413 if (maTextChangeBroadcaster)
414 maTextChangeBroadcaster();
417 sal_Int32 PresenterTextView::GetParagraphCount()
const
419 return maParagraphs.size();
423 const sal_Int32 nParagraphIndex)
const
425 if (nParagraphIndex < 0)
427 else if (nParagraphIndex>=sal_Int32(maParagraphs.size()))
430 return maParagraphs[nParagraphIndex];
435 PresenterTextParagraph::PresenterTextParagraph (
436 const sal_Int32 nParagraphIndex,
437 const Reference<i18n::XBreakIterator>& rxBreakIterator,
438 const Reference<i18n::XScriptTypeDetector>& rxScriptTypeDetector,
439 const Reference<text::XTextRange>& rxTextRange,
444 mxBreakIterator(rxBreakIterator),
445 mxScriptTypeDetector(rxScriptTypeDetector),
454 mnWritingMode (
text::WritingMode2::LR_TB),
455 mnCharacterOffset(0),
458 if (!rxTextRange.is())
464 xProperties->getPropertyValue(
"WritingMode") >>=
mnWritingMode;
466 catch(beans::UnknownPropertyException&)
475 const Reference<rendering::XCanvas>& rxCanvas,
476 const geometry::RealSize2D& rSize,
478 const rendering::ViewState& rViewState,
479 rendering::RenderState& rRenderState,
480 const double nTopOffset,
481 const double nClipTop,
482 const double nClipBottom)
489 const double nSavedM12 (rRenderState.AffineTransform.m12);
492 rRenderState.AffineTransform.m02 += rSize.Width;
494 #ifdef SHOW_CHARACTER_BOXES
514 else if (nLineTop > nClipBottom)
518 rRenderState.AffineTransform.m12 = nSavedM12 + rLine.
mnBaseLine;
520 rxCanvas->drawTextLayout (
525 rRenderState.AffineTransform.m12 = nSavedM12;
528 rRenderState.AffineTransform.m02 -= rSize.Width;
541 if ( ! rpFont || ! rpFont->mxFont.is())
544 sal_Int32 nPosition (0);
555 const rendering::FontMetrics aMetrics (rpFont->mxFont->getFontMetrics());
558 mnLineHeight = aMetrics.Ascent + aMetrics.Descent + aMetrics.ExternalLeading;
560 i18n::Boundary aCurrentLine(0,0);
567 i18n::WordType::ANYWORD_IGNOREWHITESPACES);
568 AddWord(nWidth, aCurrentLine, aWordBoundary.startPos, rpFont);
575 if (aWordBoundary.endPos>aWordBoundary.startPos)
576 AddWord(nWidth, aCurrentLine, aWordBoundary.endPos, rpFont);
578 if (aWordBoundary.startPos<0 || aWordBoundary.endPos<0)
580 if (nPosition >= aWordBoundary.endPos)
582 nPosition = aWordBoundary.endPos;
585 if (aCurrentLine.endPos>aCurrentLine.startPos)
591 const sal_Int32 nLocalCharacterIndex,
592 const sal_Int32 nDistance)
594 OSL_ASSERT(nDistance==-1 || nDistance==+1);
596 if (nLocalCharacterIndex < 0)
633 return mpCaret->GetCharacterIndex();
666 i18n::Boundary& rCurrentLine,
667 const sal_Int32 nWordBoundary,
670 sal_Int32 nLineStart (0);
672 nLineStart = rCurrentLine.startPos;
674 const OUString sLineCandidate (
677 css::geometry::RealRectangle2D aLineBox (
682 const double nLineWidth (aLineBox.X2 - aLineBox.X1);
684 if (nLineWidth >= nWidth)
689 rCurrentLine.endPos = nWordBoundary;
693 i18n::Boundary& rCurrentLine)
695 Line aLine (rCurrentLine.startPos, rCurrentLine.endPos);
710 for ( ; nCellIndex<sal_Int32(
maCells.size()); ++nCellIndex)
722 rCurrentLine.startPos = rCurrentLine.endPos;
741 const sal_Int32 nGlobalCharacterIndex)
const
760 const sal_Int32 nOffset,
761 const sal_Int32 nIndex,
762 const sal_Int16 nTextType)
const
766 case AccessibleTextType::PARAGRAPH:
772 case AccessibleTextType::SENTENCE:
787 case AccessibleTextType::WORD:
792 case AccessibleTextType::LINE:
795 [nIndex](
const Line& rLine) {
return nIndex < rLine.mnLineEndCharacterIndex; });
800 iLine->mnLineStartCharacterIndex,
801 iLine->mnLineEndCharacterIndex - iLine->mnLineStartCharacterIndex),
802 iLine->mnLineStartCharacterIndex,
803 iLine->mnLineEndCharacterIndex);
810 case AccessibleTextType::CHARACTER:
811 case AccessibleTextType::GLYPH:
812 case AccessibleTextType::ATTRIBUTE_RUN:
816 return TextSegment(OUString(), 0,0);
820 const sal_Int32 nOffset,
821 const sal_Int32 nIndex)
const
823 sal_Int32 nCurrentOffset (nOffset);
824 sal_Int32 nCurrentIndex (nIndex);
826 i18n::Boundary aWordBoundary;
827 if (nCurrentOffset == 0)
832 i18n::WordType::ANYWORD_IGNOREWHITESPACES,
834 else if (nCurrentOffset < 0)
836 while (nCurrentOffset<0 && nCurrentIndex>0)
842 i18n::WordType::ANYWORD_IGNOREWHITESPACES);
843 nCurrentIndex = aWordBoundary.startPos;
855 i18n::WordType::ANYWORD_IGNOREWHITESPACES);
856 nCurrentIndex = aWordBoundary.endPos;
865 sal_Int32 nStartIndex,
866 sal_Int32 nEndIndex)
const
868 if (nEndIndex <= nStartIndex)
881 sal_Int32 nGlobalCharacterIndex,
882 const bool bCaretBox)
897 if (nLineIndex<nLineCount-1)
907 geometry::RealRectangle2D rCellBox (rLine.
maCellBoxes[
908 ::std::min(nCellIndex, rLine.
maCellBoxes.getLength()-1)]);
910 double nLeft = nX + rCellBox.X1;
911 double nRight = nX + rCellBox.X2;
912 if (nTextDirection == rendering::TextDirection::WEAK_RIGHT_TO_LEFT)
914 const double nOldRight (nRight);
915 nRight = rLine.
mnWidth - nLeft;
916 nLeft = rLine.
mnWidth - nOldRight;
933 const sal_Int32 nX1 = sal_Int32(floor(nLeft));
934 const sal_Int32 nY1 = sal_Int32(floor(nTop));
935 const sal_Int32 nX2 = sal_Int32(ceil(nRight));
936 const sal_Int32 nY2 = sal_Int32(ceil(nBottom));
938 return awt::Rectangle(nX1,nY1,nX2-nX1+1,nY2-nY1+1);
944 return awt::Rectangle(sal_Int32(nX+0.5), sal_Int32(nY+0.5), 0, 0);
950 sal_Int32 nPosition (0);
952 while (nPosition < nTextLength)
954 const sal_Int16 nScriptDirection (
957 switch (nScriptDirection)
959 case i18n::ScriptDirection::NEUTRAL:
962 case i18n::ScriptDirection::LEFT_TO_RIGHT:
963 return rendering::TextDirection::WEAK_LEFT_TO_RIGHT;
965 case i18n::ScriptDirection::RIGHT_TO_LEFT:
966 return rendering::TextDirection::WEAK_RIGHT_TO_LEFT;
975 sal_Int8 nTextDirection(rendering::TextDirection::WEAK_LEFT_TO_RIGHT);
978 case text::WritingMode2::LR_TB:
979 nTextDirection = rendering::TextDirection::WEAK_LEFT_TO_RIGHT;
982 case text::WritingMode2::RL_TB:
983 nTextDirection = rendering::TextDirection::WEAK_RIGHT_TO_LEFT;
987 case text::WritingMode2::TB_RL:
988 case text::WritingMode2::TB_LR:
992 return nTextDirection;
1005 if ( ! rpFont || ! rpFont->mxFont.is())
1008 sal_Int32 nPosition (0);
1012 while (nPosition < nTextLength)
1018 i18n::CharacterIteratorMode::SKIPCELL,
1022 rendering::StringContext aContext (
msParagraphText, nPosition, nNewPosition-nPosition);
1023 Reference<rendering::XTextLayout> xLayout (
1024 rpFont->mxFont->createTextLayout(aContext, nTextDirection, 0));
1025 css::geometry::RealRectangle2D aCharacterBox (xLayout->queryTextBounds());
1029 nNewPosition-nPosition,
1030 aCharacterBox.X2-aCharacterBox.X1);
1032 nPosition = nNewPosition;
1039 uno::Reference<uno::XComponentContext>
const& xContext,
1040 const ::std::function<css::awt::Rectangle (
const sal_Int32,
const sal_Int32)>& rCharacterBoundsAccess,
1041 const ::std::function<
void (
const css::awt::Rectangle&)>& rInvalidator)
1044 mnCharacterIndex(-1),
1045 mnCaretBlinkTaskId(0),
1046 mbIsCaretVisible(false),
1047 maCharacterBoundsAccess(rCharacterBoundsAccess),
1048 maInvalidator(rInvalidator),
1060 catch (uno::Exception
const&)
1072 [
this] (TimeValue
const&) {
return this->
InvertCaret(); },
1094 const sal_Int32 nParagraphIndex,
1095 const sal_Int32 nCharacterIndex)
1127 const ::std::function<
void (sal_Int32,sal_Int32,sal_Int32,sal_Int32)>& rBroadcaster)
1147 const sal_Int32 nCharacterIndex,
1148 const sal_Int32 nCharacterCount,
1149 const double nCellWidth)
1150 : mnCharacterIndex(nCharacterIndex),
1151 mnCharacterCount(nCharacterCount),
1152 mnCellWidth(nCellWidth)
1159 const sal_Int32 nLineStartCharacterIndex,
1160 const sal_Int32 nLineEndCharacterIndex)
1161 : mnLineStartCharacterIndex(nLineStartCharacterIndex),
1162 mnLineEndCharacterIndex(nLineEndCharacterIndex),
1163 mnLineStartCellIndex(-1), mnLineEndCellIndex(-1),
1172 if ( mnLineStartCharacterIndex < mnLineEndCharacterIndex && !maCellBoxes.hasElements() )
1174 if (mxLayoutedLine.is())
1175 maCellBoxes = mxLayoutedLine->queryInkMeasures();
1178 OSL_ASSERT(mxLayoutedLine.is());
1184 const OUString& rsParagraphText,
1188 if ( ! mxLayoutedLine.is())
1190 const rendering::StringContext aContext (
1192 mnLineStartCharacterIndex,
1193 mnLineEndCharacterIndex - mnLineStartCharacterIndex);
1195 mxLayoutedLine = rpFont->mxFont->createTextLayout(
Reference< rendering::XCanvas > mxCanvas
sal_Int32 mnLineEndCellIndex
css::accessibility::TextSegment GetTextSegment(const sal_Int32 nOffset, const sal_Int32 nGlobalCharacterIndex, const sal_Int16 nTextType) const
std::shared_ptr< FontDescriptor > SharedFontDescriptor
static sal_Int32 ScheduleRepeatedTask(const css::uno::Reference< css::uno::XComponentContext > &xContext, const Task &rTask, const sal_Int64 nFirst, const sal_Int64 nInterval)
Schedule a task to be executed repeatedly.
css::awt::Rectangle maCaretBounds
css::uno::Reference< css::uno::XComponentContext > const & m_xContext
void SetCaretPosition(const sal_Int32 nPosition) const
sal_Int32 mnLineEndCharacterIndex
PresenterTextCaret(css::uno::Reference< css::uno::XComponentContext > const &xContext, const ::std::function< css::awt::Rectangle(const sal_Int32, const sal_Int32)> &rCharacterBoundsAccess, const ::std::function< void(const css::awt::Rectangle &)> &rInvalidator)
void SetCaretMotionBroadcaster(const ::std::function< void(sal_Int32, sal_Int32, sal_Int32, sal_Int32)> &rBroadcaster)
Set a (possibly empty) functor that broadcasts changes of the caret position.
sal_Int32 GetCaretPosition() const
A portion of a string that encodes one unicode cell.
void ProvideLayoutedLine(const OUString &rsParagraphText, const PresenterTheme::SharedFontDescriptor &rpFont, const sal_Int8 nTextDirection)
std::shared_ptr< T > make_shared(Args &&...args)
css::awt::Rectangle GetCharacterBounds(sal_Int32 nGlobalCharacterIndex, const bool bCaretBox)
const css::awt::Rectangle & GetBounds() const
::std::vector< sal_Int32 > maWordBoundaries
const sal_Int64 CaretBlinkInterval
css::uno::Reference< css::rendering::XTextLayout > mxLayoutedLine
sal_Int32 mnCharacterIndex
Line(const sal_Int32 nLineStartCharacterIndex, const sal_Int32 nLineEndCharacterIndex)
double GetTotalTextHeight() const
const ::std::function< css::awt::Rectangle(const sal_Int32, const sal_Int32)> maCharacterBoundsAccess
exports com.sun.star. text
static void CancelTask(const sal_Int32 nTaskId)
sal_Int32 mnCharacterIndex
sal_Int32 GetWordBoundary(const sal_Int32 nLocalCharacterIndex, const sal_Int32 nDistance)
const OUString & GetText() const
#define TOOLS_WARN_EXCEPTION(area, stream)
sal_Int32 mnCharacterOffset
The index of the first character in this paragraph with respect to the whole text.
sal_Int16 mnParagraphIndex
css::uno::Sequence< css::geometry::RealRectangle2D > maCellBoxes
void SetupCellArray(const PresenterTheme::SharedFontDescriptor &rpFont)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
bool IsTextReferencePointLeft() const
css::accessibility::TextSegment CreateTextSegment(sal_Int32 nStartIndex, sal_Int32 nEndIndex) const
Cell(const sal_Int32 nCharacterIndex, const sal_Int32 nCharacterCount, const double nCellWidth)
sal_Int32 mnLineStartCharacterIndex
css::accessibility::TextSegment GetWordTextSegment(const sal_Int32 nOffset, const sal_Int32 nIndex) const
css::awt::Size GetSize() const
const sal_Int32 mnParagraphIndex
void Paint(const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const css::geometry::RealSize2D &rSize, const PresenterTheme::SharedFontDescriptor &rpFont, const css::rendering::ViewState &rViewState, css::rendering::RenderState &rRenderState, const double nTopOffset, const double nClipTop, const double nClipBottom)
void AddWord(const double nWidth, css::i18n::Boundary &rCurrentLine, const sal_Int32 nWordBoundary, const PresenterTheme::SharedFontDescriptor &rpFont)
css::uno::Reference< css::i18n::XScriptTypeDetector > mxScriptTypeDetector
sal_Int8 GetTextDirection() const
PresenterTheme::SharedFontDescriptor mpFont
std::shared_ptr< PresenterTextCaret > SharedPresenterTextCaret
::std::vector< Cell > maCells
void SetPosition(const sal_Int32 nParagraphIndex, const sal_Int32 nCharacterIndex)
void AddLine(css::i18n::Boundary &rCurrentLine)
::std::function< void(sal_Int32, sal_Int32, sal_Int32, sal_Int32)> maBroadcaster
::std::vector< Line > maLines
sal_Int32 mnCharacterCount
void Format(const double nY, const double nWidth, const PresenterTheme::SharedFontDescriptor &rpFont)
sal_Int32 mnParagraphIndex
sal_Int32 GetCharacterCount() const
css::awt::Point GetRelativeLocation() const
SharedPresenterTextCaret mpCaret
static css::geometry::RealRectangle2D GetTextBoundingBox(const css::uno::Reference< css::rendering::XCanvasFont > &rxFont, const OUString &rsText, const sal_Int8=css::rendering::TextDirection::WEAK_LEFT_TO_RIGHT)
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
Reference< XSingleServiceFactory > xFactory
sal_Int32 mnLineStartCellIndex
const ::std::function< void(const css::awt::Rectangle &)> maInvalidator
void SetCharacterOffset(const sal_Int32 nCharacterOffset)
PresenterTextView(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::rendering::XCanvas > &rxCanvas, const ::std::function< void(const css::awt::Rectangle &)> &rInvalidator)
sal_Unicode GetCharacter(const sal_Int32 nGlobalCharacterIndex) const
geometry::RealSize2D maSize
std::shared_ptr< PresenterTextParagraph > SharedPresenterTextParagraph
sal_Int32 mnCaretBlinkTaskId
const uno::Reference< uno::XComponentContext > m_xContext
void SetOrigin(const double nXOrigin, const double nYOrigin)