33 #include <globstr.hrc>
34 #include <strings.hrc>
38 #include <document.hxx>
41 #include <inputwin.hxx>
64 void collectUIInformation(
const OUString& aZoom)
67 aDescription.
aID =
"grid_window";
70 aDescription.
aKeyWord =
"ScGridWinUIObject";
71 aDescription.
aParent =
"MainWindow";
82 struct ScRefFlagsAndType
88 ScRefFlagsAndType lcl_ParseRangeOrAddress(
ScRange& rScRange,
ScAddress& rScAddress,
89 const OUString& aAddress,
const ScDocument& rDoc)
91 ScRefFlagsAndType aRet;
97 aRet.nResult = rScRange.
Parse(aAddress, rDoc, eConv);
100 aRet.eDetected = DetectFlags::RANGE;
104 aRet.nResult = rScAddress.
Parse(aAddress, rDoc, eConv);
107 aRet.eDetected = DetectFlags::ADDRESS;
112 aRet.nResult = rScRange.
Parse(aAddress, rDoc);
115 aRet.eDetected = DetectFlags::RANGE;
119 aRet.nResult = rScAddress.
Parse(aAddress, rDoc);
122 aRet.eDetected = DetectFlags::ADDRESS;
130 aRet.eDetected = DetectFlags::RANGE;
138 aRet.eDetected = DetectFlags::ADDRESS;
146 aRet.eDetected = DetectFlags::RANGE;
153 aRet.eDetected = DetectFlags::ADDRESS;
170 sal_uInt16 nSlot = rReq.
GetSlot();
172 if (nSlot != SID_CURRENTCELL)
177 case FID_INSERT_FILE:
181 pReqArgs->
GetItemState(FID_INSERT_FILE,
true,&pItem) == SfxItemState::SET )
188 if ( pReqArgs->
GetItemState(FN_PARAM_1,
true,&pItem) == SfxItemState::SET )
189 aInsertPos = static_cast<const SfxPointItem*>(pItem)->GetValue();
195 bool bAsLink =
false;
196 if ( pReqArgs->
GetItemState(FN_PARAM_2,
true,&pItem) == SfxItemState::SET )
197 bAsLink = static_cast<const SfxBoolItem*>(pItem)->GetValue();
201 PasteFile( aInsertPos, aFileName, bAsLink );
206 case SID_OPENDLG_EDIT_PRINTAREA:
208 sal_uInt16
nId = ScPrintAreasDlgWrapper::GetChildWindowId();
215 case SID_CHANGE_PRINTAREA:
222 bool bEntire =
false;
224 if ( pReqArgs->
GetItemState( SID_CHANGE_PRINTAREA,
true, &pItem ) == SfxItemState::SET )
225 aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
226 if ( pReqArgs->
GetItemState( FN_PARAM_2,
true, &pItem ) == SfxItemState::SET )
227 aRowStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
228 if ( pReqArgs->
GetItemState( FN_PARAM_3,
true, &pItem ) == SfxItemState::SET )
229 aColStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
230 if ( pReqArgs->
GetItemState( FN_PARAM_4,
true, &pItem ) == SfxItemState::SET )
231 bEntire = static_cast<const SfxBoolItem*>(pItem)->GetValue();
240 case SID_ADD_PRINTAREA:
241 case SID_DEFINE_PRINTAREA:
243 bool bAdd = ( nSlot == SID_ADD_PRINTAREA );
248 if ( pReqArgs->
GetItemState( SID_DEFINE_PRINTAREA,
true, &pItem ) == SfxItemState::SET )
249 aPrintStr = static_cast<const SfxStringItem*>(pItem)->GetValue();
260 case SID_DELETE_PRINTAREA:
270 case FID_DEL_MANUALBREAKS:
275 case FID_ADJUST_PRINTZOOM:
280 case FID_RESET_PRINTZOOM:
286 case SID_STATUS_PAGESTYLE:
289 ExecutePageStyle( *
this, rReq,
GetViewData().GetTabNo() );
293 case SID_CURRENTCELL:
298 if ( pReqArgs->
GetItemState( nSlot,
true, &pItem ) == SfxItemState::SET )
299 aAddress = static_cast<const SfxStringItem*>(pItem)->GetValue();
300 else if ( nSlot == SID_JUMPTOMARK && pReqArgs->
GetItemState(
301 SID_JUMPTOMARK,
true, &pItem ) == SfxItemState::SET )
302 aAddress = static_cast<const SfxStringItem*>(pItem)->GetValue();
308 bool bUnmark = ( nSlot == SID_CURRENTCELL );
309 if ( pReqArgs->
GetItemState( FN_PARAM_1,
true, &pItem ) == SfxItemState::SET )
310 bUnmark = static_cast<const SfxBoolItem*>(pItem)->GetValue();
312 bool bAlignToCursor =
true;
313 if (pReqArgs->
GetItemState(FN_PARAM_2,
true, &pItem) == SfxItemState::SET)
314 bAlignToCursor = static_cast<const SfxBoolItem*>(pItem)->GetValue();
316 if ( nSlot == SID_JUMPTOMARK )
329 ScRefFlagsAndType aResult = lcl_ParseRangeOrAddress(aScRange, aScAddress, aAddress, rDoc);
335 if (aResult.eDetected == DetectFlags::RANGE)
352 else if (aResult.eDetected == DetectFlags::ADDRESS)
356 if( aScAddress.
Tab() != nTab )
358 nTab = aScAddress.
Tab();
363 aScAddress.
SetTab( nTab );
365 aScRange =
ScRange( aScAddress, aScAddress );
387 sal_Int32 nNumeric = aAddress.toInt32();
388 if ( nNumeric > 0 && nNumeric <= rDoc.
MaxRow()+1 )
392 aScAddress.
SetRow( static_cast<SCROW>(nNumeric - 1) );
394 aScAddress.
SetTab( nTab );
395 aScRange =
ScRange( aScAddress, aScAddress );
405 if( nResult & ScRefFlags::VALID )
410 bool bNothing = ( rViewData.
GetCurX()==nCol && rViewData.
GetCurY()==nRow );
422 bNothing = ( aCurrent == aOldMark );
459 rBindings.
Update( nSlot );
480 if ( rDoc.
GetTable( aAddress, nNameTab ) )
483 if ( nNameTab != nTab )
488 if ( !bFound && nSlot == SID_JUMPTOMARK )
495 if (!bFound && !rReq.
IsAPI())
500 case SID_CURRENTOBJECT:
517 rBindings.
Update( nSlot );
529 OUString aStrDocName( static_cast<const SfxStringItem&>(pReqArgs->
538 while ( pDocSh && !bFound )
540 if ( pDocSh->
GetTitle() == aStrDocName )
543 bFound = (
nullptr != pViewFrame );
556 case SID_PRINTPREVIEW:
573 case SID_DETECTIVE_DEL_ALL:
581 case SID_TABLE_ACTIVATE:
582 OSL_FAIL(
"old slot SID_TABLE_ACTIVATE");
593 case FID_NORMALVIEWMODE:
594 case FID_PAGEBREAKMODE:
596 bool bWantPageBreak = nSlot == FID_PAGEBREAKMODE;
600 if ( pReqArgs && pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET )
603 bWantPageBreak = (nSlot == FID_PAGEBREAKMODE) == bItemValue;
621 case FID_FUNCTION_BOX:
632 case FID_TOGGLESYNTAX:
636 if ( pReqArgs && pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET )
637 bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
645 case FID_TOGGLEHEADERS:
649 if ( pReqArgs && pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET )
650 bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
659 case FID_TOGGLEFORMULA:
665 if( pReqArgs && pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET )
666 bFormulaMode = static_cast<const SfxBoolItem *>(pItem)->GetValue();
680 case FID_TOGGLEINPUTLINE:
682 sal_uInt16
nId = ScInputWindowWrapper::GetChildWindowId();
684 bool bSet = ( pWnd == nullptr );
686 if ( pReqArgs && pReqArgs->
GetItemState(nSlot,
true, &pItem) == SfxItemState::SET )
687 bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
711 if (SID_ZOOM_OUT == nSlot)
717 bool bSyncZoom =
SC_MOD()->GetAppOptions().GetSynchronizeZoom();
720 SetZoom(aFract, aFract, bSyncZoom);
737 bool bSyncZoom =
SC_MOD()->GetAppOptions().GetSynchronizeZoom();
741 sal_uInt16 nOldZoom =
static_cast<sal_uInt16
>(
tools::Long( rOldY * 100 ));
742 sal_uInt16 nZoom = nOldZoom;
743 bool bCancel =
false;
749 eNewZoomType = rZoomItem.
GetType();
750 nZoom = rZoomItem.GetValue();
755 SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
759 | SvxZoomEnableFlags::N75
760 | SvxZoomEnableFlags::N100
761 | SvxZoomEnableFlags::N150
762 | SvxZoomEnableFlags::N200
763 | SvxZoomEnableFlags::WHOLEPAGE
764 | SvxZoomEnableFlags::PAGEWIDTH;
767 nBtnFlags = nBtnFlags | SvxZoomEnableFlags::OPTIMAL;
769 aZoomItem.SetValueSet( nBtnFlags );
770 aSet.Put( aZoomItem );
782 Get( SID_ATTR_ZOOM );
784 eNewZoomType = rZoomItem.
GetType();
785 nZoom = rZoomItem.GetValue();
791 if ( eNewZoomType == SvxZoomType::PERCENT )
798 nZoom =
CalcZoom( eNewZoomType, nOldZoom );
799 bCancel = nZoom == 0;
802 switch ( eNewZoomType )
804 case SvxZoomType::WHOLEPAGE:
805 case SvxZoomType::PAGEWIDTH:
814 if ( nZoom != nOldZoom && !bCancel )
824 SetZoom( aFract, aFract, bSyncZoom );
835 case SID_ATTR_ZOOMSLIDER:
838 bool bSyncZoom =
SC_MOD()->GetAppOptions().GetSynchronizeZoom();
839 if ( pReqArgs && pReqArgs->
GetItemState(SID_ATTR_ZOOMSLIDER,
true, &pItem) == SfxItemState::SET )
848 aNewOpt.
SetZoom( nCurrentZoom );
849 collectUIInformation(OUString::number(nCurrentZoom));
853 Fraction aFract( nCurrentZoom,100 );
854 SetZoom( aFract, aFract, bSyncZoom );
867 case FID_TAB_SELECTALL:
872 case FID_TAB_DESELECTALL:
877 case SID_SELECT_TABLES:
885 ::std::vector < sal_Int32 > aIndexList;
894 pDlg->SetDescription(
895 ScResId( STR_DLG_SELECTTABLES_TITLE ),
896 ScResId( STR_DLG_SELECTTABLES_LBNAME ),
901 for( nTab = 0; nTab < nTabCount; ++nTab )
903 rDoc.
GetName( nTab, aTabName );
907 if( pDlg->Execute() ==
RET_OK )
909 aIndexList = pDlg->GetSelectedRows();
910 pDlg.disposeAndClear();
917 if ( !aIndexList.empty() )
919 sal_uInt16 nSelCount = aIndexList.size();
921 SCTAB nFirstVisTab = 0;
924 bool bVisSelected =
false;
925 for( nSelIx = 0; !bVisSelected && (nSelIx < nSelCount); ++nSelIx )
927 nFirstVisTab =
static_cast<SCTAB>(aIndexList[nSelIx]);
928 bVisSelected = rDoc.
IsVisible( nFirstVisTab );
936 for( nTab = 0; nTab < nTabCount; ++nTab )
939 for( nSelIx = 0; nSelIx < nSelCount; ++nSelIx )
940 rMark.
SelectTable( static_cast<SCTAB>(aIndexList[nSelIx]),
true );
960 case SID_OUTLINE_DELETEALL:
965 case SID_AUTO_OUTLINE:
970 case SID_WINDOW_SPLIT:
1003 bool bChangedX =
false, bChangedY =
false;
1016 if (bChangedX || bChangedY)
1024 if (rOtherViewData.
GetTabNo() != nThisTab)
1037 case SID_WINDOW_FIX_COL:
1038 case SID_WINDOW_FIX_ROW:
1040 bool bIsCol = (nSlot == SID_WINDOW_FIX_COL);
1041 sal_Int32 nFreezeIndex = 1;
1044 nFreezeIndex = pItem->GetValue();
1045 if (nFreezeIndex < 0)
1062 if (rOtherViewData.
GetTabNo() != nThisTab)
1082 sal_uInt16
nId = ScHighlightChgDlgWrapper::GetChildWindowId();
1089 case FID_CHG_ACCEPT:
1104 case FID_CHG_COMMENT:
1115 pReqArgs->
GetItemState( nSlot,
true, &pItem ) == SfxItemState::SET &&
1119 pDocSh->SetChangeComment( pAction, aComment );
1124 pDocSh->ExecuteChangeCommentDialog(pAction,
GetFrameWeld());
1131 case SID_CREATE_SW_DRAWVIEW:
1141 case FID_PROTECT_DOC:
1148 if( pReqArgs->
HasItem( FID_PROTECT_DOC, &pItem ) &&
1159 bool bCancel =
false;
1164 OUString aText(
ScResId(SCSTR_PASSWORD));
1167 aDlg.set_title(
ScResId(SCSTR_UNPROTECTDOC));
1186 OUString aText(
ScResId(SCSTR_PASSWORDOPT));
1189 aDlg.set_title(
ScResId(SCSTR_PROTECTDOC));
1208 case FID_PROTECT_TABLE:
1217 bool bNewProtection = !bOldProtection;
1218 if( pReqArgs->
HasItem( FID_PROTECT_TABLE, &pItem ) )
1219 bNewProtection = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1220 if( bNewProtection == bOldProtection )
1234 OUString aText(
ScResId(SCSTR_PASSWORDOPT) );
1236 aDlg.set_title(
ScResId(SCSTR_UNPROTECTTAB));
1287 case SID_OPT_LOCALE_CHANGED :
1295 OSL_FAIL(
"Unknown Slot at ScTabViewShell::Execute");
SC_DLLPUBLIC bool IsDocProtected() const
ScMarkData & GetMarkData()
void SetEditHelpId(const OString &rId)
SfxViewFrame * GetViewFrame() const
SvxZoomType GetZoomType() const
void SetOption(ScViewOption eOpt, bool bNew)
ScDocShell * GetDocShell() const
void FreezeSplitters(bool bFreeze, SplitMethod eSplitMethod=SC_SPLIT_METHOD_CURSOR, SCCOLROW nFreezeIndex=-1)
void RemoveManualBreaks()
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
SfxChildWindow * GetChildWindow(sal_uInt16)
static SfxInterface * GetStaticInterface()
SfxViewFrame * GetFrame() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
void SetPrintRanges(bool bEntireSheet, const OUString *pPrint, const OUString *pRepCol, const OUString *pRepRow, bool bAddPrint)
bool SelectObject(std::u16string_view rName)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
sheet protection state container
void SetHeaderMode(bool bNewMode)
SfxDispatcher * GetDispatcher()
void SetPagebreakMode(bool bSet)
static SvxAbstractDialogFactory * Create()
void RepeatResize(bool bUpdateFix=true)
SCCOLROW GetLOKSheetFreezeIndex(bool bIsCol) const
virtual bool isProtected() const override
const ContentProperties & rData
bool IsSyntaxMode() const
void Done(bool bRemove=false)
ScDocument & GetDocument() const
virtual bool isProtectedWithPass() const override
virtual short run() override
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
void TabChanged(bool bSameTabButMoved=false)
Called after moving, copying, inserting or deleting a sheet.
static void forEachOtherView(ViewShellType *pThisViewShell, FunctionType f)
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
virtual const SfxItemSet * GetOutputItemSet() const =0
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL)
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
void GetMarkArea(ScRange &rRange) const
void ToggleChildWindow(sal_uInt16)
#define HID_PASSWD_DOC_CONFIRM
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
void disposeAndReset(reference_type *pBody)
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC SCTAB GetTableCount() const
void SetConfirmHelpId(const OString &rId)
bool Unprotect(SCTAB nTab, const OUString &rPassword)
bool IsMultiMarked() const
SfxFrame & GetFrame() const
SC_DLLPUBLIC void SetRefDialog(sal_uInt16 nId, bool bVis, SfxViewFrame *pViewFrm=nullptr)
Reference dialogs.
void SetOptions(const ScViewOptions &rOpt)
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
ScSplitMode GetHSplitMode() const
bool isdigitAsciiString(const OString &rString)
const Fraction & GetZoomY() const
ScDrawLayer * MakeDrawLayer()
ScViewData & GetViewData()
void SelectionChanged(bool bFromPaste=false)
SfxItemPool & GetPool() const
bool PasteFile(const Point &, const OUString &, bool bLink)
SC_DLLPUBLIC void SetAppOptions(const ScAppOptions &rOpt)
SC_DLLPUBLIC ScDocProtection * GetDocProtection() const
void SetZoom(const Fraction &rNewX, const Fraction &rNewY, bool bAll)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SelectTable(SCTAB nTab, bool bNew)
SfxBindings & GetBindings()
virtual VclPtr< AbstractScShowTabDlg > CreateScShowTabDlg(weld::Window *pParent)=0
SfxBindings & GetBindings()
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
SC_DLLPUBLIC const ScAppOptions & GetAppOptions()
const T * GetArg(sal_uInt16 nSlotId) const
void ShowExtras(SfxShowExtras nExtras)
OUString ScResId(const char *pId)
bool GetOption(ScViewOption eOpt) const
void RemoveAllOutlines(bool bRecord=true)
sal_uInt16 CalcZoom(SvxZoomType eType, sal_uInt16 nOldZoom)
void SetDialogData(const ScTableProtection &rData)
void SetZoom(sal_uInt16 nNew)
bool SetLOKSheetFreezeIndex(const SCCOLROW nFreezeIndex, bool bIsCol, SCTAB nForTab=-1)
SfxViewShell * GetViewShell() const
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static bool MakeRangeFromName(const OUString &rName, const ScDocument &rDoc, SCTAB nCurTab, ScRange &rRange, RutlNameScope eScope=RUTL_NAMES, ScAddress::Details const &rDetails=ScAddress::detailsOOOa1)
void SetMinLen(sal_uInt16 Len)
virtual void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax)=0
void SetReturnValue(const SfxPoolItem &)
void SetPrintZoom(sal_uInt16 nScale)
void Update(sal_uInt16 nId)
void SkipOverlapped(SCCOL &rCol, SCROW &rRow, SCTAB nTab) const
sal_uInt16 GetSlot() const
SC_DLLPUBLIC void PutInOrder()
bool ValidRow(SCROW nRow) const
weld::Window * GetFrameWeld() const
void SetCurSubShell(ObjectSelectionType eOST, bool bForce=false)
void ProtectSheet(SCTAB nTab, const ScTableProtection &rProtect)
ScDrawView * GetScDrawView()
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
void ErrorMessage(const char *pGlobStrId)
SvxZoomType GetType() const
bool IsHeaderMode() const
static SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
static SC_DLLPUBLIC ScAbstractDialogFactory * Create()
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
void Protect(SCTAB nTab, const OUString &rPassword)
OUString GetPassword() const
const ScViewOptions & GetOptions() const
void SetZoomType(SvxZoomType eNew)
void AlignToCursor(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, const ScSplitPos *pWhich=nullptr)
void ShowChildWindow(sal_uInt16, bool bVisible=true)
void SetZoomType(SvxZoomType eNew, bool bAll)
ObjectSelectionType GetCurObjectSelectionType() const
void Execute(SfxRequest &rReq)
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void InvalidateAll(bool bWithMsg)
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
void AppendItem(const SfxPoolItem &)
Point GetInsertPos() const
void SetSyntaxMode(bool bNewMode)
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool GetTableSelect(SCTAB nTab) const
std::map< OUString, OUString > aParameters
bool IsPagebreakMode() const
const std::vector< sal_Int32 > & GetList() const
void WriteData(ScTableProtection &rData) const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
void UpdatePageBreakData(bool bForcePaint=false)
ScSplitMode GetVSplitMode() const
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
virtual bool isProtectedWithPass() const override
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
static OUString decode(OUString const &rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)