30#include <com/sun/star/accessibility/XAccessible.hpp>
31#include <com/sun/star/accessibility/XAccessibleContext.hpp>
32#include <com/sun/star/accessibility/XAccessibleText.hpp>
33#include <com/sun/star/awt/FontSlant.hpp>
34#include <com/sun/star/beans/PropertyValue.hpp>
35#include <com/sun/star/style/LineSpacing.hpp>
36#include <com/sun/star/style/TabStop.hpp>
68 }
catch(...) {
return E_FAIL; }
92 }
catch(...) {
return E_FAIL; }
114 OUString ouStr(o3tl::toU(*
text));
121 }
catch(...) {
return E_FAIL; }
145 }
catch(...) {
return E_FAIL; }
168 }
catch(...) {
return E_FAIL; }
191 OUString ouStr(o3tl::toU(*
text));
197 }
catch(...) {
return E_FAIL; }
215 if (attributes ==
nullptr)
220 OUString ouStr(o3tl::toU(*attributes));
222 std::vector< OUString > vecAttr;
224 vecAttr.push_back(ouStr.getToken(0,
';',
nIndex));
227 auto beanSeqRange = asNonConstRange(beanSeq);
228 for(std::vector<OUString>::size_type
i = 0;
i < vecAttr.size();
i ++)
230 OUString attr = vecAttr[
i];
231 sal_Int32
nPos = attr.indexOf(
':');
235 OUString attrValue = attr.copy(
nPos + 1);
246 }
catch(...) {
return E_FAIL; }
258 if(ouName ==
u"CharBackColor" ||
259 ouName ==
u"CharColor" ||
260 ouName ==
u"ParaAdjust" ||
261 ouName ==
u"ParaFirstLineIndent" ||
262 ouName ==
u"ParaLeftMargin" ||
263 ouName ==
u"ParaRightMargin" ||
264 ouName ==
u"ParaTopMargin" ||
265 ouName ==
u"ParaBottomMargin" ||
266 ouName ==
u"CharFontPitch" )
270 sal_Int32
nValue = ouValue.toInt32();
273 else if(ouName ==
u"CharShadowed" ||
274 ouName ==
u"CharContoured" )
277 rAny <<= ouValue.toBoolean();
279 else if(ouName ==
u"CharEscapement" ||
280 ouName ==
u"CharStrikeout" ||
281 ouName ==
u"CharUnderline" ||
282 ouName ==
u"CharFontPitch" )
285 short nValue =
static_cast<short>(ouValue.toInt32());
288 else if(ouName ==
u"CharHeight" ||
289 ouName ==
u"CharWeight" )
292 float fValue = ouValue.toFloat();
295 else if(ouName ==
u"CharFontName" )
300 else if(ouName ==
u"CharPosture" )
303 css::awt::FontSlant fontSlant =
static_cast<css::awt::FontSlant
>(ouValue.toInt32());
306 else if(ouName ==
u"ParaTabStops" )
310 std::vector< css::style::TabStop > vecTabStop;
311 css::style::TabStop tabStop;
313 sal_Int32
pos = 0, posComma = 0;
318 pos = ouValue.indexOf(
"Position=",
pos);
321 posComma = ouValue.indexOf(
',',
pos + 9);
324 ouSubValue = ouValue.copy(
pos + 9, posComma -
pos - 9);
325 tabStop.Position = ouSubValue.toInt32();
329 pos = ouValue.indexOf(
"TabAlign=",
pos);
332 posComma = ouValue.indexOf(
',',
pos + 9);
335 ouSubValue = ouValue.copy(
pos + 9, posComma -
pos - 9);
336 tabStop.Alignment =
static_cast<css::style::TabAlign
>(ouSubValue.toInt32());
340 pos = ouValue.indexOf(
"DecimalChar=",
pos);
343 posComma = ouValue.indexOf(
',',
pos + 11);
346 ouSubValue = ouValue.copy(
pos + 11, posComma -
pos - 11);
347 tabStop.DecimalChar = ouSubValue.toChar();
351 pos = ouValue.indexOf(
"FillChar=",
pos);
354 posComma = ouValue.indexOf(
',',
pos + 9);
357 ouSubValue = ouValue.copy(
pos + 9, posComma -
pos - 9);
358 tabStop.DecimalChar = ouSubValue.toChar();
362 vecTabStop.push_back(tabStop);
388 while(
pos < ouValue.getLength());
392 int iSeqLen = vecTabStop.empty() ? 1 : vecTabStop.size();
394 auto pseqTabStop = seqTabStop.getArray();
396 if (!vecTabStop.empty())
399 for(
int i = 0;
i < iSeqLen;
i ++)
401 pseqTabStop[
i] = vecTabStop[
i];
407 pseqTabStop[0].Position = 0;
408 pseqTabStop[0].Alignment = css::style::TabAlign_DEFAULT;
409 pseqTabStop[0].DecimalChar =
'.';
410 pseqTabStop[0].FillChar =
' ';
416 else if(ouName ==
u"ParaLineSpacing" )
419 css::style::LineSpacing lineSpacing;
421 sal_Int32
pos = 0, posComma = 0;
423 pos = ouValue.indexOf(
"Mode=",
pos);
426 posComma = ouValue.indexOf(
',',
pos + 5);
429 ouSubValue = ouValue.copy(
pos + 5, posComma -
pos - 5);
430 lineSpacing.Mode =
static_cast<sal_Int16
>(ouSubValue.toInt32());
433 pos = ouValue.indexOf(
"Height=",
pos);
436 ouSubValue = ouValue.copy(
pos + 7);
437 lineSpacing.Height =
static_cast<sal_Int16
>(ouSubValue.toInt32());
441 lineSpacing.Height = sal_Int16(100);
446 lineSpacing.Height = sal_Int16(100);
452 lineSpacing.Mode = sal_Int16(0);
453 lineSpacing.Height = sal_Int16(100);
462 sal_Int32 nDefault = 0;
483 if( !pRContext.is() )
494 }
catch(...) {
return E_FAIL; }
STDMETHOD() setAttributes(long startOffset, long endOffset, BSTR *attributes) override
Sets attributes of range of text.
static void get_AnyFromOLECHAR(std::u16string_view ouName, const OUString &ouValue, css::uno::Any &rAny)
Convert attributes string to Any type.
STDMETHOD() copyText(long startOffset, long endOffset) override
Copy a range of text to the clipboard.
STDMETHOD() replaceText(long startOffset, long endOffset, BSTR *text) override
Replaces range of text with new text.
STDMETHOD() put_XInterface(hyper pXInterface) override
Override of IUNOXWrapper.
css::uno::Reference< css::accessibility::XAccessibleEditableText > pRXEdtTxt
STDMETHOD() insertText(long offset, BSTR *text) override
Inserts text at a specified offset.
STDMETHOD() deleteText(long startOffset, long endOffset) override
Deletes a range of text.
STDMETHOD() pasteText(long offset) override
Pastes text from clipboard at specified offset.
STDMETHOD() cutText(long startOffset, long endOffset) override
Cuts a range of text to the clipboard.
css::accessibility::XAccessibleEditableText * GetXInterface()
STDMETHOD() put_XInterface(hyper pXInterface) override
css::accessibility::XAccessible * pUNOInterface