20 #include <config_features.h>
22 #include <com/sun/star/util/SearchAlgorithms2.hpp>
25 #include <com/sun/star/sdb/DatabaseContext.hpp>
26 #include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
27 #include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
28 #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
29 #include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
30 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
31 #include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
32 #include <com/sun/star/linguistic2/XDictionary.hpp>
33 #include <officecfg/Office/Common.hxx>
101 #include <section.hxx>
106 #include <sfx2/strings.hrc>
108 #include <strings.hrc>
110 #include <globals.hrc>
121 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
135 #include <osl/diagnose.h>
140 #include <viewimp.hxx>
144 #include <string_view>
151 using namespace sfx2;
200 if (!rPgStr.isEmpty() && std::u16string_view(OUString::number(nPhyNum)) != rPgStr)
202 else if (nPhyNum != nVirtNum)
203 extra = OUString::number(nVirtNum);
205 sal_uInt16 nPageCount = GetWrtShell().GetPageCnt();
206 sal_uInt16 nPrintedPhyNum = nPhyNum;
207 sal_uInt16 nPrintedPageCount = nPageCount;
208 if (!GetWrtShell().getIDocumentDeviceAccess().getPrintData().IsPrintEmptyPages())
211 OUString
aStr( nPageCount != nPrintedPageCount
212 ?
SwResId(STR_PAGE_COUNT_PRINTED)
213 : (extra.isEmpty() ?
SwResId(STR_PAGE_COUNT) :
SwResId(STR_PAGE_COUNT_CUSTOM)));
214 aStr = aStr.replaceFirst(
"%1", OUString::number(nPhyNum));
215 aStr = aStr.replaceFirst(
"%2", OUString::number(nPageCount));
216 if (nPageCount != nPrintedPageCount)
218 aStr = aStr.replaceFirst(
"%3", OUString::number(nPrintedPhyNum));
219 aStr = aStr.replaceFirst(
"%4", OUString::number(nPrintedPageCount));
222 aStr = aStr.replaceFirst(
"%3", extra);
230 SwWait aWait( *GetDocShell(),
true );
243 if ( aMetadata.
read(aGraphic) )
249 aTransform.
rotate( aRotation );
263 bLink ? rPath : OUString(),
264 bLink ? rFilter : OUString(),
281 rShell.
Insert( sURL, rFilter, aGraphic, &aFrameManager );
285 rShell.
Insert( OUString(), OUString(), aGraphic, &aFrameManager );
297 bool bReturn =
false;
301 OUString sGraphicFormat =
SwResId(STR_POOLFRM_GRAPHIC);
305 #if HAVE_FEATURE_DESKTOP
309 ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE,
311 pFileDlg->SetTitle(
SwResId(STR_INSERT_GRAPHIC ));
314 uno::Reference < XFilePicker3 > xFP = pFileDlg->GetFilePicker();
315 uno::Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
318 xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0,
makeAny(
true));
319 xCtrlAcc->enableControl( ExtendedFilePickerElementIds::CHECKBOX_LINK,
false);
322 std::vector<OUString> aFormats;
324 for(
size_t i = 0;
i < nArrLen; ++
i )
329 aFormats.push_back(pFormat->
GetName());
334 const std::vector<OUString>& rFramePoolArr(
336 for(
const auto &
i : rFramePoolArr)
338 aFormats.push_back(
i);
341 std::sort(aFormats.begin(), aFormats.end());
342 aFormats.erase(std::unique(aFormats.begin(), aFormats.end()), aFormats.end());
345 OUString* pEntries = aListBoxEntries.getArray();
346 sal_Int16 nSelect = 0;
347 for(
size_t i = 0;
i < aFormats.size(); ++
i )
349 pEntries[
i] = aFormats[
i];
350 if(pEntries[
i] == sGraphicFormat)
355 Any aTemplates(&aListBoxEntries,
cppu::UnoType<decltype(aListBoxEntries)>::
get());
357 xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
358 ListboxControlActions::ADD_ITEMS , aTemplates );
361 xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
362 ListboxControlActions::SET_SELECT_ITEM, aSelectPos );
366 OSL_FAIL(
"control access failed");
371 bool bShowError = !pName;
373 #
if HAVE_FEATURE_DESKTOP
379 OUString aFileName, aFilterName;
387 #if HAVE_FEATURE_DESKTOP
390 aFileName = pFileDlg->GetPath();
391 aFilterName = pFileDlg->GetCurrentFilter();
395 bool bAsLink =
false;
396 if(nHtmlMode & HTMLMODE_ON)
402 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
403 OSL_ENSURE(aVal.hasValue(),
"Value CBX_INSERT_AS_LINK not found");
404 bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
405 Any aTemplateValue = xCtrlAcc->getValue(
406 ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
407 ListboxControlActions::GET_SELECTED_ITEM );
409 aTemplateValue >>= sTmpl;
414 OSL_FAIL(
"control access failed");
423 bool bAsLink =
false;
425 #if HAVE_FEATURE_DESKTOP
426 if( nHtmlMode & HTMLMODE_ON )
434 if ( pStyle && !pStyle->GetValue().isEmpty() )
435 sGraphicFormat = pStyle->GetValue();
439 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
440 OSL_ENSURE(aVal.hasValue(),
"Value CBX_INSERT_AS_LINK not found");
441 bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
442 Any aTemplateValue = xCtrlAcc->getValue(
443 ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
444 ListboxControlActions::GET_SELECTED_ITEM );
446 aTemplateValue >>= sTmpl;
447 if( !sTmpl.isEmpty() )
448 sGraphicFormat = sTmpl;
457 if (aWarnDlg.run() !=
RET_OK)
493 const char* pResId(
nullptr);
495 pResId = STR_GRFILTER_OPENERROR;
497 pResId = STR_GRFILTER_IOERROR;
499 pResId = STR_GRFILTER_FORMATERROR;
501 pResId = STR_GRFILTER_VERSIONERROR;
503 pResId = STR_GRFILTER_FILTERERROR;
505 pResId = STR_GRFILTER_TOOBIG;
514 VclMessageType::Info, VclButtonsType::Ok,
536 const sal_uInt16 nSlot = rReq.
GetSlot();
539 bool bIgnore =
false;
546 deckId =
"InspectorDeck";
550 case SID_CREATE_SW_DRAWVIEW:
551 m_pWrtShell->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
559 aContext.maEndDialogFn = [](sal_Int32){};
566 case SID_REFRESH_VIEW:
567 GetEditWin().Invalidate();
568 m_pWrtShell->Reformat();
573 case FN_PAGEDOWN_SEL:
577 if (
FN_PAGEUP == nSlot || FN_PAGEUP_SEL == nSlot )
578 PageUpCursor(FN_PAGEUP_SEL == nSlot);
580 PageDownCursor(FN_PAGEDOWN_SEL == nSlot);
583 aVis != GetVisArea()));
591 tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
592 if (SID_ZOOM_OUT == nSlot)
596 SetZoom(SvxZoomType::PERCENT, nFact);
602 sal_uInt16 nPage = 0;
603 if (m_pWrtShell->IsCursorVisible())
604 nPage = m_pWrtShell->GetCursor()->GetPageNum();
607 SwFrame* pPageFrame = m_pWrtShell->Imp()->GetFirstVisPage(m_pWrtShell->GetOut());
613 sal_uInt16 nOldPage(nPage);
616 else if (
FN_TO_NEXT_PAGE == nSlot && nPage < m_pWrtShell->GetPageCount())
618 if (nPage != nOldPage)
620 m_pWrtShell->LockPaint();
623 m_pWrtShell->EnterStdMode();
624 m_pWrtShell->GotoPage(nPage,
true);
626 const Point aPt(m_aVisArea.Left(), m_pWrtShell->GetPagePos(nPage).Y());
627 Point aAlPt(AlignToPixel(aPt));
628 if(aPt.Y() != aAlPt.Y())
629 aAlPt.AdjustY(3 * GetEditWin().PixelToLogic(
Size(0, 1)).
Height());
631 m_pWrtShell->UnlockPaint();
638 if (m_pWrtShell->IsSelFrameMode())
640 if (!m_pWrtShell->IsStdMode())
641 m_pWrtShell->EnterStdMode();
642 SwShellCursor *pCursor = m_pWrtShell->SwCursorShell::GetCursor_();
645 sal_uInt16 nStep = m_aSelectCycle.nStep;
646 if (nStep && (CurrMarkPt != m_aSelectCycle.m_MarkPt || CurrPointPt != m_aSelectCycle.m_PointPt))
651 m_aSelectCycle.m_pInitialCursor = CurrPointPt;
652 m_pWrtShell->SwCursorShell::ClearMark();
653 m_pWrtShell->SelWrd(&CurrPointPt);
656 m_pWrtShell->SelSentence(&CurrPointPt);
659 m_pWrtShell->SelPara(&CurrPointPt);
662 m_pWrtShell->SwCursorShell::ClearMark();
663 m_pWrtShell->SwCursorShell::SetCursor(m_aSelectCycle.m_pInitialCursor);
668 pCursor = m_pWrtShell->SwCursorShell::GetCursor_();
670 m_aSelectCycle.m_PointPt = pCursor->
GetPtPos();
671 m_aSelectCycle.nStep = nStep;
677 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
681 if( aPasswd.hasElements() )
683 OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->
GetValue(),
"SwView::Execute(): password set and redlining off doesn't match!" );
686 if (aPasswd.getLength() == 1 && aPasswd[0] == 1)
689 VclMessageType::Warning, VclButtonsType::YesNo,
690 SfxResId(RID_SVXSTR_END_REDLINING_WARNING)));
691 xWarn->set_default_response(
RET_NO);
722 pViewFrame->GetBindings().Invalidate(FN_REDLINE_ON);
723 pViewFrame->GetBindings().Update(FN_REDLINE_ON);
728 case FN_REDLINE_PROTECT :
732 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem )
740 if (!aPasswd.hasElements())
741 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
742 if (aPasswdDlg.
run())
746 Sequence <sal_Int8> aNewPasswd =
749 if(!aPasswd.hasElements())
759 m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~
RedlineFlags::On) | nOn);
769 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem))
774 m_pWrtShell->StartAllAction();
776 if ( m_pWrtShell->GetViewOptions()->IsShowChangesInMargin() &&
777 m_pWrtShell->GetViewOptions()->IsShowChangesInMargin2() )
779 GetDocShell()->GetDoc()->GetDocumentRedlineManager().HideAll(!bShow);
781 m_pWrtShell->GetLayout()->SetHideRedlines( !bShow );
782 m_pWrtShell->EndAllAction();
783 if (m_pWrtShell->IsRedlineOn())
784 m_pWrtShell->SetInsMode();
789 GetViewFrame()->ToggleChildWindow(nSlot);
796 SwDoc *pDoc = m_pWrtShell->GetDoc();
797 SwPaM *pCursor = m_pWrtShell->GetCursor();
800 if (pArgs && pArgs->
GetItemState(nSlot,
false, &pItem) == SfxItemState::SET)
805 if (nChangeId == rRedlineTable[
i]->GetId())
813 m_pWrtShell->AcceptRedlinesInSelection();
815 m_pWrtShell->RejectRedlinesInSelection();
829 if (nRedline < rRedlineTable.
size())
830 pRedline = rRedlineTable[nRedline];
835 assert(pRedline !=
nullptr);
839 m_pWrtShell->AcceptRedline(nRedline);
841 m_pWrtShell->RejectRedline(nRedline);
856 SwDoc* pDoc = m_pWrtShell->GetDoc();
859 if (pArgs && pArgs->
GetItemState(nSlot,
false, &pItem) == SfxItemState::SET)
864 if (nChangeId == rRedlineTable[
i]->GetId())
870 if (nRedline < rRedlineTable.
size())
871 pNext = m_pWrtShell->GotoRedline(nRedline,
true);
873 pNext = m_pWrtShell->SelNextRedline();
879 OString aPayload(
".uno:CurrentTrackedChangeId=");
880 sal_uInt32 nRedlineId = pNext->
GetId();
881 aPayload += OString::number(nRedlineId);
882 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
885 m_pWrtShell->SetInSelect();
899 OString aPayload(
".uno:CurrentTrackedChangeId=");
900 sal_uInt32 nRedlineId = pPrev->
GetId();
901 aPayload += OString::number(nRedlineId);
902 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
905 m_pWrtShell->SetInSelect();
910 case SID_DOCUMENT_COMPARE:
911 case SID_DOCUMENT_MERGE:
913 OUString sFileName, sFilterName;
915 bool bHasFileName =
false;
916 m_pViewImpl->SetParam( 0 );
917 bool bNoAcceptDialog =
false;
921 if( SfxItemState::SET == pArgs->
GetItemState( SID_FILE_NAME,
false, &pItem ))
922 sFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
923 bHasFileName = !sFileName.isEmpty();
925 if( SfxItemState::SET == pArgs->
GetItemState( SID_FILTER_NAME,
false, &pItem ))
926 sFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
928 if( SfxItemState::SET == pArgs->
GetItemState( SID_VERSION,
false, &pItem ))
931 m_pViewImpl->SetParam( nVersion );
933 if( SfxItemState::SET == pArgs->
GetItemState( SID_NO_ACCEPT_DIALOG,
false, &pItem ))
939 m_pViewImpl->InitRequest( rReq );
940 tools::Long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion );
946 if (nFound > 0 && !bNoAcceptDialog)
952 const sal_uInt16
nId = SwRedlineAcceptChild::GetChildWindowId();
964 GetViewFrame()->ShowChildWindow(nSlot);
968 if ( m_pWrtShell->HasDrawViewDrag() )
970 m_pWrtShell->BreakDrag();
971 m_pWrtShell->EnterSelFrameMode();
973 else if ( m_pWrtShell->IsDrawCreate() )
975 GetDrawFuncPtr()->BreakCreate();
976 AttrChangedNotify(
nullptr);
978 else if ( m_pWrtShell->HasSelection() || IsDrawMode() )
980 SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() :
nullptr;
991 Point aPt(LONG_MIN, LONG_MIN);
994 SfxBindings& rBind = GetViewFrame()->GetBindings();
997 m_pWrtShell->EnterStdMode();
998 AttrChangedNotify(
nullptr);
1001 else if ( GetEditWin().GetApplyTemplate() )
1005 else if( static_cast<SfxObjectShell*>(GetDocShell())->IsInPlaceActive() )
1009 else if ( GetEditWin().IsChainMode() )
1011 GetEditWin().SetChainMode(
false );
1013 else if( m_pWrtShell->GetFlyFrameFormat() )
1015 const SwFrameFormat* pFormat = m_pWrtShell->GetFlyFrameFormat();
1018 m_pWrtShell->HideCursor();
1019 m_pWrtShell->EnterSelFrameMode();
1025 GetViewFrame()->GetDispatcher()->ExecuteList(SID_WIN_FULLSCREEN,
1026 SfxCallMode::RECORD, { &aItem });
1031 case SID_ATTR_BORDER_INNER:
1032 case SID_ATTR_BORDER_OUTER:
1033 case SID_ATTR_BORDER_SHADOW:
1035 m_pWrtShell->SetAttrSet(*pArgs);
1039 case SID_ATTR_PAGE_SIZE:
1040 case SID_ATTR_PAGE_MAXSIZE:
1041 case SID_ATTR_PAGE_PAPERBIN:
1042 case SID_ATTR_PAGE_EXT1:
1047 const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
1048 SwPageDesc aPageDesc( m_pWrtShell->GetPageDesc( nCurIdx ) );
1051 m_pWrtShell->ChgPageDesc( nCurIdx, aPageDesc );
1064 GetViewFrame()->GetDispatcher()->Execute(
1070 const SwTOXBase* pBase = m_pWrtShell->GetCurTOX();
1074 const bool bWasLocked = m_pWrtShell->IsViewLocked();
1075 m_pWrtShell->LockView(
true);
1076 m_pWrtShell->StartAction();
1078 m_pWrtShell->ApplyAutoMark();
1079 m_pWrtShell->UpdateTableOf( *pBase );
1080 m_pWrtShell->EndAction();
1082 m_pWrtShell->LockView(
false);
1088 m_pWrtShell->StartAction();
1089 m_pWrtShell->EnterStdMode();
1090 bool bOldCursorInReadOnly = m_pWrtShell->IsReadOnlyAvailable();
1091 m_pWrtShell->SetReadOnlyAvailable(
true );
1093 for(
int i = 0;
i < 2; ++
i )
1095 if( m_pWrtShell->GetTOXCount() == 1 )
1098 while( m_pWrtShell->GotoPrevTOXBase() )
1102 const SwTOXBase* pBase = m_pWrtShell->GetCurTOX();
1105 m_pWrtShell->GotoNextTOXBase();
1106 pBase = m_pWrtShell->GetCurTOX();
1109 bool bAutoMarkApplied =
false;
1114 m_pWrtShell->ApplyAutoMark();
1115 bAutoMarkApplied =
true;
1118 m_pWrtShell->UpdateTableOf( *pBase );
1120 if( m_pWrtShell->GotoNextTOXBase() )
1121 pBase = m_pWrtShell->GetCurTOX();
1126 m_pWrtShell->SetReadOnlyAvailable( bOldCursorInReadOnly );
1127 m_pWrtShell->EndAction();
1130 case SID_ATTR_BRUSH:
1134 const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
1135 SwPageDesc aDesc( m_pWrtShell->GetPageDesc( nCurIdx ));
1138 m_pWrtShell->ChgPageDesc( nCurIdx, aDesc);
1142 case SID_CLEARHISTORY:
1144 m_pWrtShell->DelAllUndoObj();
1152 #if defined(_WIN32) || defined UNX
1153 case SID_TWAIN_SELECT:
1154 case SID_TWAIN_TRANSFER:
1155 GetViewImpl()->ExecuteScan( rReq );
1159 case SID_ATTR_DEFTABSTOP:
1161 if(pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_DEFTABSTOP,
false, &pItem))
1166 m_pWrtShell->SetDefault( aDefTabs );
1170 case SID_ATTR_LANGUAGE :
1171 if(pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_LANGUAGE,
false, &pItem))
1174 m_pWrtShell->SetDefault( aLang );
1178 case SID_ATTR_CHAR_CTL_LANGUAGE:
1181 m_pWrtShell->SetDefault( *pItem );
1185 case SID_ATTR_CHAR_CJK_LANGUAGE:
1188 m_pWrtShell->SetDefault( *pItem );
1194 m_pWrtShell->EnterStdMode();
1195 size_t nPos(m_pWrtShell->GetOutlinePos());
1196 m_pWrtShell->ToggleOutlineContentVisibility(
nPos);
1197 m_pWrtShell->GotoOutline(
nPos);
1208 bool *pbNext =
new bool(
true);
1211 MoveNavigationHdl(pbNext);
1214 case SID_JUMPTOMARK:
1215 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_JUMPTOMARK,
false, &pItem))
1216 JumpToSwMark( static_cast<const SfxStringItem*>(pItem)->GetValue() );
1220 GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
1224 GetViewFrame()->GetFrame().GetFrameInterface());
1226 case SID_AVMEDIA_PLAYER :
1227 GetViewFrame()->ChildWindowExecute(rReq);
1229 case SID_VIEW_DATA_SOURCE_BROWSER:
1244 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
1245 bShow = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1246 if((bShow && m_bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot))
1247 GetViewFrame()->ToggleChildWindow(nSlot);
1250 #if HAVE_FEATURE_DBCONNECTIVITY
1259 AttrChangedNotify(
nullptr);
1262 PropertyValue*
pValues = aProperties.getArray();
1263 pValues[0].Name =
"DataSourceName";
1264 pValues[1].Name =
"Command";
1265 pValues[2].Name =
"CommandType";
1267 pValues[1].Value <<= aData.
sCommand;
1273 m_bInMailMerge &= bShow;
1279 bool bUseCurrentDocument =
true;
1280 bool bQuery = !pArgs || SfxItemState::SET != pArgs->
GetItemState(nSlot);
1291 GenerateFormLetter(bUseCurrentDocument);
1294 case SID_RECHECK_DOCUMENT:
1298 uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( pDoc->
GetGCIterator() );
1299 if( xGCIterator.is() )
1301 xGCIterator->resetIgnoreRules();
1307 if( xDictionary.is() )
1308 xDictionary->clear();
1310 m_pWrtShell->StartOfSection();
1316 if (rReq.
GetArgs() !=
nullptr)
1318 static_cast<const SfxBoolItem&>( (rReq.
GetArgs()->
1327 case SID_ALIGN_ANY_LEFT :
1328 case SID_ALIGN_ANY_HCENTER :
1329 case SID_ALIGN_ANY_RIGHT :
1330 case SID_ALIGN_ANY_JUSTIFIED:
1331 case SID_ALIGN_ANY_TOP :
1332 case SID_ALIGN_ANY_VCENTER :
1333 case SID_ALIGN_ANY_BOTTOM :
1334 case SID_ALIGN_ANY_HDEFAULT :
1335 case SID_ALIGN_ANY_VDEFAULT :
1337 sal_uInt16 nAlias = 0;
1342 case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT;
break;
1343 case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER;
break;
1344 case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT;
break;
1345 case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK;
break;
1346 case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE;
break;
1347 case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER;
break;
1348 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM;
break;
1355 case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ;
break;
1356 case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ;
break;
1357 case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ;
break;
1358 case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ;
break;
1359 case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ;
break;
1360 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ;
break;
1365 GetViewFrame()->GetDispatcher()->Execute(
1366 nAlias, SfxCallMode::ASYNCHRON);
1369 case SID_RESTORE_EDITING_VIEW:
1374 if(m_pViewImpl->GetRestorePosition(aCursorPos, bSelectObj))
1376 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1379 m_pWrtShell->SelectObj( aCursorPos );
1380 m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1385 case SID_INSERT_GRAPHIC:
1390 case SID_MOVE_SHAPE_HANDLE:
1392 if (pArgs && pArgs->
Count() == 3)
1394 SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() :
nullptr;
1395 if (pSdrView ==
nullptr)
1402 const sal_uLong newPosX = newPosXTwips->GetValue();
1403 const sal_uLong newPosY = newPosYTwips->GetValue();
1410 OSL_ENSURE(
false,
"wrong dispatcher");
1434 SfxBindings &rBnd = GetViewFrame()->GetBindings();
1440 SfxBindings &rBnd = GetViewFrame()->GetBindings();
1452 OSL_ENSURE( nWhich,
"empty set");
1458 const OUString& sCurrentSectionName = CurrSect->
GetSectionName();
1459 if(sCurrentSectionName != m_sOldSectionName)
1463 m_sOldSectionName = sCurrentSectionName;
1465 else if (!m_sOldSectionName.isEmpty())
1468 m_sOldSectionName= OUString();
1482 sal_uInt16 nPage, nLogPage;
1486 aStringList.push_back(GetPageStr(nPage, nLogPage, sDisplay));
1487 bool bExtendedTooltip(!sDisplay.isEmpty() &&
1488 std::u16string_view(OUString::number(nPage)) != sDisplay &&
1490 OUString aTooltip = bExtendedTooltip ?
SwResId(STR_BOOKCTRL_HINT_EXTENDED)
1492 aStringList.push_back(aTooltip);
1495 if (m_nOldPageNum != nLogPage )
1497 if (m_nOldPageNum != 0)
1499 m_nOldPageNum = nLogPage;
1501 const sal_uInt16 nCnt = GetWrtShell().GetPageCnt();
1502 if (m_nPageCnt != nCnt)
1519 const char* pResId = selectionStats.
nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION;
1520 const char* pWordResId = selectionStats.
nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION;
1521 const char* pCharResId = selectionStats.
nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION;
1524 OUString aWordArg =
SwResId(pWordResId, nWord).replaceAll(
"$1", rLocaleData.
getNum(nWord, 0));
1525 OUString aCharArg =
SwResId(pCharResId, nChar).replaceAll(
"$1", rLocaleData.
getNum(nChar, 0));
1526 OUString aWordCount(
SwResId(pResId));
1527 aWordCount = aWordCount.replaceAll(
"$1", aWordArg);
1528 aWordCount = aWordCount.replaceAll(
"$2", aCharArg);
1534 pWrdCnt->
SetCounts(selectionStats, documentStats);
1547 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1556 SvxZoomEnableFlags::N50|
1557 SvxZoomEnableFlags::N75|
1558 SvxZoomEnableFlags::N100|
1559 SvxZoomEnableFlags::N150|
1560 SvxZoomEnableFlags::N200);
1568 case SID_ATTR_VIEWLAYOUT:
1570 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1576 rSet.
Put( aViewLayout );
1582 case SID_ATTR_ZOOMSLIDER:
1584 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1587 const sal_uInt16 nCurrentZoom = pVOpt->
GetZoom();
1594 const bool bAutomaticViewLayout = 0 == nColumns;
1603 Size aPageSize( aPageRect.SSize() );
1608 Size aRootSize( aRootRect.SSize() );
1610 const MapMode aTmpMap( MapUnit::MapTwip );
1611 const Size& rEditSize = GetEditWin().GetOutputSizePixel();
1612 const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
1615 tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
1617 aPageSize.AdjustHeight(nOf );
1621 nFac = std::min( nFac, nVisPercent );
1628 if ( bAutomaticViewLayout )
1631 nFac = aWindowSize.
Width() * 100 / nTmpWidth;
1632 nFac = std::min( nFac, nVisPercent );
1640 rSet.
Put( aZoomSliderItem );
1646 case SID_ATTR_POSITION:
1656 if ( nWhich == SID_ATTR_POSITION )
1666 case SID_TABLE_CELL:
1689 switch( pCurrSect->
GetType() )
1694 const SwTOXBase* pTOX = m_pWrtShell->GetCurTOX();
1700 "Unknown kind of section" );
1713 const bool bOutlineNum = pNumRule && pNumRule->
IsOutlineRule();
1715 if (pNumRule && !bOutlineNum )
1725 if(SfxItemState::DEFAULT <=
1728 const OUString& rNumStyle =
1730 if(!rNumStyle.isEmpty())
1738 if (!sStr.isEmpty())
1740 sStr +=
SwResId(STR_NUM_LEVEL) + OUString::number( nNumLevel + 1 );
1745 if( nOutlineLevel != 0 )
1747 if (!sStr.isEmpty())
1751 sStr +=
SwResId(STR_OUTLINE_NUMBERING) +
1755 sStr +=
SwResId(STR_NUM_OUTLINE);
1756 sStr += OUString::number( nOutlineLevel);
1761 if (!sStr.isEmpty())
1763 sStr =
SwResId(SW_STR_READONLY) + sStr;
1765 if (!sStr.isEmpty())
1781 case SID_ATTR_INSERT:
1804 sal_uInt16 nWhich = rReq.
GetSlot();
1809 GetViewFrame()->GetDispatcher()->Execute(
FN_GOTO_PAGE,
1810 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1817 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1824 if (SfxItemState::SET == pArgs->
GetItemState( nWhich,
true, &pItem))
1828 if(nIdx < pMarkAccess->getBookmarksCount())
1835 OSL_FAIL(
"SwView::ExecuteStatusLine(..)"
1836 " - Ignoring out of range bookmark index");
1844 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1849 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1865 SvxZoomEnableFlags::N50|
1866 SvxZoomEnableFlags::N75|
1867 SvxZoomEnableFlags::N100|
1868 SvxZoomEnableFlags::N150|
1869 SvxZoomEnableFlags::N200);
1871 aCoreSet.Put( aZoom );
1876 aCoreSet.Put( aViewLayout );
1887 if ( pSet && SfxItemState::SET == pSet->
GetItemState(SID_ATTR_VIEWLAYOUT,
true, &pViewLayoutItem))
1890 const bool bBookMode =
static_cast<const SvxViewLayoutItem *
>(pViewLayoutItem)->IsBookMode();
1891 SetViewLayout( nColumns, bBookMode );
1894 if ( pSet && SfxItemState::SET == pSet->
GetItemState(SID_ATTR_ZOOM,
true, &pItem))
1897 SetZoom( eType, static_cast<const SvxZoomItem *>(pItem)->
GetValue() );
1907 case SID_ATTR_VIEWLAYOUT:
1910 ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) )
1912 if ( SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_VIEWLAYOUT,
true, &pItem ))
1915 const bool bBookMode = (0 != nColumns && 0 == (nColumns % 2)) &&
1918 SetViewLayout( nColumns, bBookMode );
1924 InvalidateRulerPos();
1929 case SID_ATTR_ZOOMSLIDER:
1931 if ( pArgs && ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) )
1933 if ( SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_ZOOMSLIDER,
true, &pItem ))
1936 SetZoom( SvxZoomType::PERCENT, nCurrentZoom );
1970 nId = SID_ATTR_TRANSFORM;
1973 GetViewFrame()->GetDispatcher()->Execute(nId,
1974 SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
1982 if (SfxItemState::SET == pArgs->
GetItemState( nWhich,
true, &pItem))
1984 switch ( static_cast<const SfxUInt16Item *>(pItem)->GetValue() )
2011 case SID_ATTR_INSERT:
2025 SfxBindings &rBnd = GetViewFrame()->GetBindings();
2033 if ( m_pWrtShell->HasWholeTabSelection() )
2038 m_pWrtShell->
GetPageDesc(m_pWrtShell->GetCurPageDesc()).GetMaster();
2039 SwTwips lWidth = rPageFormat.GetFrameSize().GetWidth();
2042 aMgr.SetSize(
Size(lWidth, aMgr.GetSize().Height()));
2047 aMgr.SetCol( aCol );
2049 aMgr.InsertFlyFrame();
2052 GetEditWin().InsFrame(nCols);
2058 bool bWeb =
dynamic_cast<SwWebView*
>( this ) !=
nullptr;
2069 SAL_WARN(
"sw.ui",
"JumpToTOXMark: missing separator");
2072 sal_Int32
const counter(rName.copy(0,
first).toInt32());
2075 SAL_WARN(
"sw.ui",
"JumpToTOXMark: invalid counter");
2081 SAL_WARN(
"sw.ui",
"JumpToTOXMark: missing separator");
2084 OUString
const entry(rName.copy(
first + 1, second - (
first + 1)));
2085 if (rName.getLength() < second + 2)
2087 SAL_WARN(
"sw.ui",
"JumpToTOXMark: invalid tox");
2090 sal_uInt16
const indexType(rName[second + 1]);
2091 OUString
const indexName(rName.copy(second + 2));
2104 for (
auto i = rSh.GetTOXTypeCount(
TOX_USER); 0 <
i; )
2107 auto const pTmp(rSh.GetTOXType(
TOX_USER,
i));
2108 if (pTmp->GetTypeName() == indexName)
2118 SAL_WARN(
"sw.ui",
"JumpToTOXMark: tox doesn't exist");
2126 if (&tmp != &rSh.GetDoc()->GotoTOXMark(tmp,
TOX_SAME_NXT, rSh.IsReadOnlyAvailable()))
2128 for (sal_Int32
i = 0;
i < counter; ++
i)
2136 SAL_WARN(
"sw.ui",
"JumpToTOXMark: tox mark doesn't exist");
2144 if( !rMark.isEmpty() )
2147 bool bSaveCC = m_bCenterCursor;
2148 bool bSaveCT = m_bTopCursor;
2149 SetCursorAtTop(
true );
2152 bool bHasShFocus = m_pWrtShell->HasShellFocus();
2154 m_pWrtShell->ShellGetFocus();
2163 while( -1 != ( nLastPos = sMark.indexOf(
cMarkSeparator, nPos + 1 )) )
2169 sCmp = sMark.copy(nPos + 1).replaceAll(
" ",
"");
2171 if( !sCmp.isEmpty() )
2173 OUString
sName( sMark.copy( 0, nPos ) );
2174 sCmp = sCmp.toAsciiLowerCase();
2177 if (sCmp ==
"drawingobject")
2178 bRet = m_pWrtShell->GotoDrawingObject(
sName);
2179 else if( sCmp ==
"region" )
2181 m_pWrtShell->EnterStdMode();
2182 bRet = m_pWrtShell->GotoRegion(
sName );
2184 else if( sCmp ==
"outline" )
2186 m_pWrtShell->EnterStdMode();
2187 bRet = m_pWrtShell->GotoOutline(
sName );
2189 else if( sCmp ==
"frame" )
2191 else if( sCmp ==
"graphic" )
2193 else if( sCmp ==
"ole" )
2195 else if( sCmp ==
"table" )
2197 m_pWrtShell->EnterStdMode();
2198 bRet = m_pWrtShell->GotoTable(
sName );
2200 else if( sCmp ==
"sequence" )
2202 m_pWrtShell->EnterStdMode();
2206 sal_uInt16 nSeqNo =
sName.copy( nNoPos + 1 ).toInt32();
2211 else if (sCmp ==
"toxmark")
2215 else if( sCmp ==
"text" )
2218 m_pWrtShell->EnterStdMode();
2221 SearchAlgorithms_ABSOLUTE, 0,
2225 TransliterationFlags::IGNORE_CASE,
2226 SearchAlgorithms2::ABSOLUTE,
2232 m_pWrtShell->EnterStdMode();
2238 bRet = m_pWrtShell->GotoMark( *ppMark,
false );
2240 else if(
nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) )) {
2241 m_pWrtShell->addCurrentPosition();
2252 m_pWrtShell->UnSelectFrame();
2253 m_pWrtShell->LeaveSelFrameMode();
2257 m_pWrtShell->HideCursor();
2258 m_pWrtShell->EnterSelFrameMode();
2264 bRet = m_pWrtShell->GotoMark( *ppMark,
false );
2266 else if(
nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) ))
2270 if ( m_aVisArea.IsEmpty() )
2271 m_bMakeSelectionVisible =
true;
2274 SetCursorAtTop( bSaveCT, bSaveCC );
2276 if(!m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected())
2277 m_pWrtShell->ShowCursor();
2280 m_pWrtShell->ShellLoseFocus();
2293 for(
size_t i = 0;
i < nCnt; ++
i )
2309 m_pViewImpl->InitRequest( rRequest );
2310 m_pViewImpl->SetParam( pItem ? 1 : 0 );
2311 const sal_uInt16 nSlot = rRequest.
GetSlot();
2315 InsertDoc( nSlot,
"",
"" );
2319 OUString sFile, sFilter;
2322 sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue();
2324 bool bHasFileName = !sFile.isEmpty();
2325 tools::Long nFound = InsertDoc( nSlot, sFile, sFilter );
2337 std::unique_ptr<SfxMedium> pMed;
2340 if( !rFileName.isEmpty() )
2346 pMed.reset(
new SfxMedium(rFileName, StreamMode::READ,
nullptr,
nullptr ));
2348 pMed->UseInteractionHandler(
true );
2349 ErrCode nErr = aMatcher.GuessFilter(*pMed, pFilter, SfxFilterFlags::NONE);
2353 pMed->SetFilter( pFilter );
2356 pMed.reset(
new SfxMedium(rFileName, StreamMode::READ, pFilter,
nullptr));
2360 m_pViewImpl->StartDocumentInserter(
2362 SwDocShell::Factory().GetFactoryName(),
2372 return InsertMedium( nSlotId, std::move(pMed), nVersion );
2377 bool bInsert =
false, bCompare =
false;
2383 case SID_DOCUMENT_MERGE:
break;
2384 case SID_DOCUMENT_COMPARE: bCompare =
true;
break;
2385 case SID_INSERTDOC: bInsert =
true;
break;
2388 OSL_ENSURE(
false,
"unknown SlotId!" );
2395 uno::Reference< frame::XDispatchRecorder > xRecorder =
2396 GetViewFrame()->GetBindings().GetRecorder();
2397 if ( xRecorder.is() )
2399 SfxRequest aRequest(GetViewFrame(), SID_INSERTDOC);
2401 if(pMedium->GetFilter())
2415 pMedium->Download();
2416 if( aRef.
is() && 1 < aRef->GetRefCount() )
2421 (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER) )
2423 size_t nUndoCheck = 0;
2425 if( pRead && pDocSh->
GetDoc() )
2430 SwWait aWait( *GetDocShell(),
true );
2431 m_pWrtShell->StartAllAction();
2432 if ( m_pWrtShell->HasSelection() )
2433 m_pWrtShell->DelRight();
2436 nErrno = pRdr->Read( *pRead );
2442 uno::Reference<text::XTextRange>
const xInsertPosition(
2444 *m_pWrtShell->GetCursor()->GetPoint(),
nullptr));
2445 nErrno = pDocSh->
ImportFrom(*pMedium, xInsertPosition)
2452 if( m_pWrtShell->IsUpdateTOX() )
2456 m_pWrtShell->SetUpdateTOX(
false );
2468 m_pWrtShell->EndAllAction();
2472 nFound = nErrno.
IsError() ? -1 : 0;
2485 OUString(), nVersion, pDocSh );
2488 SwWait aWait( *GetDocShell(),
true );
2489 m_pWrtShell->StartAllAction();
2491 m_pWrtShell->EnterStdMode();
2494 nFound = m_pWrtShell->CompareDoc( *static_cast<SwDocShell*>( xDocSh.
get() )->GetDoc() );
2496 nFound = m_pWrtShell->MergeDoc( *static_cast<SwDocShell*>( xDocSh.
get() )->GetDoc() );
2498 m_pWrtShell->EndAllAction();
2500 if (!bCompare && !nFound)
2503 VclMessageType::Info, VclButtonsType::Ok,
2504 SwResId(STR_NO_MERGE_ENTRY)));
2507 if( nRet==2 && xDocSh.
is() )
2517 m_bInMailMerge =
true;
2518 SfxBindings& rBind = GetViewFrame()->GetBindings();
2523 #if HAVE_FEATURE_DBCONNECTIVITY
2527 bool lcl_NeedAdditionalDataSource(
const uno::Reference< XDatabaseContext >& _rDatasourceContext )
2531 return ( !aNames.hasElements()
2532 || ( ( 1 == aNames.getLength() )
2533 && aNames.getConstArray()[0] ==
SW_MOD()->GetDBConfig()->GetBibliographySource().sDataSource
2543 #if !HAVE_FEATURE_DBCONNECTIVITY
2544 (
void) bUseCurrentDocument;
2546 if(bUseCurrentDocument)
2548 if(!GetWrtShell().IsAnyDatabaseFieldInDoc())
2552 uno::Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
2553 bool bCallAddressPilot =
false;
2554 if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2558 std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog(
"DataSourcesUnavailableDialog"));
2560 if (
RET_OK != xQuery->run())
2562 bCallAddressPilot =
true;
2569 if(
RET_OK == pConnectionsDlg->Execute())
2570 bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
2575 if(bCallAddressPilot)
2577 GetViewFrame()->GetDispatcher()->Execute(
2578 SID_ADDRESS_DATA_SOURCE, SfxCallMode::SYNCHRON);
2579 if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2595 SfxCallMode::SYNCHRON, { &aOn });
2601 if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
2604 std::unique_ptr<weld::MessageDialog> xWarning(xBuilder->weld_message_dialog(
"WarnDataSourceDialog"));
2605 OUString sTmp(xWarning->get_primary_text());
2606 xWarning->set_primary_text(sTmp.replaceFirst(
"%1", sSource));
2607 if (
RET_OK == xWarning->run())
2616 SwDBManager* pDBManager = GetWrtShell().GetDBManager();
2621 std::vector<OUString> aDBNameList;
2622 std::vector<OUString> aAllDBNames;
2624 if(!aDBNameList.empty())
2626 OUString sDBName(aDBNameList[0]);
2633 AttrChangedNotify(
nullptr);
2638 PropertyValue*
pValues = aProperties.getArray();
2639 pValues[0].Name =
"DataSourceName";
2640 pValues[1].Name =
"Command";
2641 pValues[2].Name =
"CommandType";
2643 pValues[1].Value <<= aData.
sCommand;
2655 int nRet = aDocTemplDlg.
run();
2656 bool bNewWin =
false;
2682 std::unique_ptr<SfxMedium> pMed = m_pViewImpl->CreateMedium();
2686 VclMessageType::Info, VclButtonsType::Ok,
2687 SwResId(RID_SVXSTR_TXTFILTER_FILTERERROR)));
2692 const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot();
2693 tools::Long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() );
2695 if ( SID_INSERTDOC == nSlot )
2697 if ( m_pViewImpl->GetParam() == 0 )
2699 m_pViewImpl->GetRequest()->SetReturnValue(
SfxBoolItem( nSlot, nFound != -1 ) );
2700 m_pViewImpl->GetRequest()->Ignore();
2704 m_pViewImpl->GetRequest()->SetReturnValue(
SfxBoolItem( nSlot, nFound != -1 ) );
2705 m_pViewImpl->GetRequest()->Done();
2708 else if ( SID_DOCUMENT_COMPARE == nSlot || SID_DOCUMENT_MERGE == nSlot )
2710 m_pViewImpl->GetRequest()->SetReturnValue(
SfxInt32Item( nSlot, nFound ) );
2718 sal_uInt16
nId = SwRedlineAcceptChild::GetChildWindowId();
2729 m_pViewImpl->ExecuteScan(rReq) ;
2734 return GetCachedString(OldGrfCat);
2739 SetCachedString(OldGrfCat, sStr);
2744 return GetCachedString(OldTabCat);
2749 SetCachedString(OldTabCat, sStr);
2754 return GetCachedString(OldFrameCat);
2759 SetCachedString(OldFrameCat, sStr);
2764 return GetCachedString(OldDrwCat);
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
#define LINK(Instance, Class, Member)
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Base class of the Writer layout elements.
bool JumpToSwMark(const OUString &rMark)
void StateStatusLine(SfxItemSet &)
get status of the status line
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
IDocumentStatistics const & getIDocumentStatistics() const
virtual SfxObjectFactory & GetFactory() const =0
const OUString & GetOldGrfCat()
OUString const & GetCurPageStyle() const
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
SfxChildWindow * GetChildWindow(sal_uInt16)
bool JumpToSwMark(SwViewShell const *pVwSh, const OUString &rMark)
void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
static SfxAbstractDialogFactory * Create()
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false) override
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(96)
static const std::vector< OUString > & GetFrameFormatUINameArray()
const SwNumRule * GetNumRuleAtCurrCursorPos() const
SfxDispatcher * GetDispatcher()
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
bool AreObjectsMarked() const
tools::Long InsertDoc(sal_uInt16 nSlotId, const OUString &rFileName, const OUString &rFilterName, sal_Int16 nVersion=0)
static SvxAbstractDialogFactory * Create()
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
tools::Long GetRight() const
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
static const AllSettings & GetSettings()
void CountWords(SwDocStat &rStat) const
Count words in current selection.
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
SwFrameFormat * MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, bool bBroadcast=false, bool bAuto=true)
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
sal_uInt16 GetPageSelection() const
Provides access to the marks of a document.
#define FN_FORMAT_TABLE_DLG
static SVL_DLLPUBLIC void GetHashPassword(css::uno::Sequence< sal_Int8 > &rPassHash, const char *pPass, sal_uInt32 nLen)
static weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false)
void setOriginURL(OUString const &rOriginURL)
const ContentProperties & rData
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
void Done(bool bRemove=false)
void ExtendedSelectAll(bool bFootnotes=true)
virtual short run() override
weld::Window * GetTopWindow() const
IMPL_LINK(SvDDEObject, ImplGetDDEData, const DdeData *, pData, void)
virtual const SwDocStat & GetUpdatedDocStat(bool bCompleteAsync, bool bFields)=0
Updates the document statistics if the document has been modified and returns a reference to the resu...
IDocumentUndoRedo & GetIDocumentUndoRedo()
void ExecuteScan(SfxRequest &rReq)
const OUString & GetOldFrameCat()
void SetCachedString(CachedStringID id, const OUString &sStr)
Of course Writer needs its own rectangles.
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
#define ERRCODE_GRFILTER_IOERROR
int SwFindDocShell(SfxObjectShellRef &xDocSh, SfxObjectShellLock &xLockRef, const OUString &rFileName, const OUString &rPasswd, const OUString &rFilter, sal_Int16 nVersion, SwDocShell *pDestSh)
Find the right DocShell and create a new one: The return value specifies what should happen to the Sh...
virtual short Execute()=0
SwFrameFormat * FindFrameFormatByName(std::u16string_view rName) const
virtual const SfxItemSet * GetOutputItemSet() const =0
sal_uInt8 GetNumLevel() const
void SetUseInputLanguage(bool bNew)
#i42732# display status of font size/name depending on either the input language or the selection pos...
SfxApplication * SfxGetpApp()
const SwSection * GetCurrSection() const
SvxZoomType GetZoomType() const
Used by the UI to modify the document model.
void ToggleChildWindow(sal_uInt16)
constexpr tools::Long Width() const
#define FN_NUMBER_BULLETS
void disposeAndReset(reference_type *pBody)
void AddSnappingPoint(sal_Int32 nNew)
virtual VclPtr< AbstractMailMergeFieldConnectionsDlg > CreateMailMergeFieldConnectionsDlg(weld::Window *pParent)=0
virtual VclPtr< AbstractMailMergeCreateFromDlg > CreateMailMergeCreateFromDlg(weld::Window *pParent)=0
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
sal_uInt16 GetDocumentBorder() const
static void SetFrameMode_(FlyMode eMode)
PropertiesInfo aProperties
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool getBrowseMode() const
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
#define FN_EDIT_CURRENT_TOX
virtual void DelAllUndoObj()=0
Delete all Undo actions.
weld::Window * GetFrameWeld() const
#define FN_PARAM_FTN_INFO
Point GetAnchorObjDiff() const
Methods for status line.
const LocaleDataWrapper & GetUILocaleDataWrapper() const
#define ERRCODE_GRFILTER_OPENERROR
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint)
#define ERRCODE_GRFILTER_FORMATERROR
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
const OUString & GetName() const
void SetAlternativeText(const OUString &rAlt)
static css::uno::Reference< css::linguistic2::XDictionary > GetIgnoreAllList()
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
const OUString & GetOldTabCat()
virtual bool IsConditionalFastCall(const SfxRequest &rReq) override
#define FN_INSERT_FIELD_DATA_ONLY
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
#define FN_LINE_NUMBERING_DLG
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
void GenerateFormLetter(bool bUseCurrentDocument)
constexpr OUStringLiteral aData
const OUString & GetOldDrwCat()
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
SwDoc * GetDoc()
returns Doc. But be careful!
static ErrCode HandleFilter(SfxMedium *pMedium, SfxObjectShell const *pDoc)
PaM is Point and Mark: a selection of the document model.
#define FN_REDLINE_ACCEPT_DIRECT
static void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
const SwTableNode * IsCursorInTable() const
virtual bool IsThisDocument() const =0
bool HasSelection() const
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void EditLinkDlg()
show "edit link" dialog
const OUString & GetSectionName() const
void ChildWindowExecute(SfxRequest &)
bool IsViewLayoutBookMode() const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
const SwPageDesc & GetPageDesc(const size_t i) const
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
virtual bool IsConditionalFastCall(const SfxRequest &rReq)
void Push()
store a copy of the current cursor on the cursor stack
sal_Unicode const toxMarkSeparator
separator for toxmarks: #%19%19|toxmark
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
#define FN_REDLINE_ACCEPT_TONEXT
SfxBindings & GetBindings()
ErrCode InsertGraphic(const OUString &rPath, const OUString &rFilter, bool bLink, GraphicFilter *pFlt)
void SetOldFrameCat(const OUString &sStr)
static void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
vector_type::size_type size_type
const OUString & GetValue() const
#define FN_REDLINE_PREV_CHANGE
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
const T * GetArg(sal_uInt16 nSlotId) const
tools::Long GetLeft() const
void ShowExtras(SfxShowExtras nExtras)
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
static size_t lcl_PageDescWithHeader(const SwDoc &rDoc)
size_t GetPageDescCnt() const
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
void AddRule(SwUndoArg eWhat, const OUString &rWith)
SwDBData const & GetDBData() const
Database information.
const Point & GetMkPos() const
static SwAbstractDialogFactory * Create()
tools::ULong GetSidebarBorderWidth(bool bPx=false) const
#define FN_WORDCOUNT_DIALOG
#define FN_UPDATE_CUR_TOX
OUString SwResId(const char *pId)
OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString &rPgStr)
Create string for showing the page number in the statusbar.
Reader * StartConvertFrom(SfxMedium &rMedium, SwReaderPtr &rpRdr, SwCursorShell const *pCursorSh=nullptr, SwPaM *pPaM=nullptr)
For inserting document.
bool HasReadonlySel() const
#define FN_SELECTION_CYCLE
const char sStatusDelim[]
#define FN_REDLINE_REJECT_TONEXT
void ExecuteStatusLine(SfxRequest &)
execute method for the status line
tools::ULong GetSidebarWidth(bool bPx=false) const
bool StartExecuteAsync(const std::function< void(sal_Int32)> &rEndDialogFn)
const sal_Unicode cMarkSeparator
static auto JumpToTOXMark(SwWrtShell &rSh, OUString const &rName) -> bool
#define FN_STAT_WORDCOUNT
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
void SpellItAgainSam(bool bInvalid, bool bOnlyWrong, bool bSmartTags)
Re-trigger spelling in the idle handler.
const SwPosition * Start() const
OUString GetBoxNms() const
SwFrameFormat * GetTableFormat()
void SetMinLen(sal_uInt16 Len)
css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const
const SwFrameFormat * GetDfltFrameFormat() const
SW_DLLPUBLIC bool HasActiveSidebarWin() const
virtual void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax)=0
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
void SetReturnValue(const SfxPoolItem &)
const LanguageTag & getLocale()
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
SdrHdl * GetFocusHdl() const
void Update(sal_uInt16 nId)
tools::Long InsertMedium(sal_uInt16 nSlotId, std::unique_ptr< SfxMedium > pMedium, sal_Int16 nVersion)
void ResetAttr(const o3tl::sorted_vector< sal_uInt16 > &attrs=o3tl::sorted_vector< sal_uInt16 >(), SwPaM *pCursor=nullptr)
#define ERRCODE_GRFILTER_TOOBIG
#define ERRCODE_GRFILTER_FILTERERROR
#define FN_FORMAT_FRAME_DLG
void UpdatePageNums()
invalidate page numbering field
SwFrameFormat & GetMaster()
const PropertyValue * pValues
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define ERRCODE_GRFILTER_VERSIONERROR
void GotoMark(const ::sw::mark::IMark *const pMark)
sal_uInt16 GetSlot() const
void ExecuteInsertDoc(SfxRequest &rRequest, const SfxPoolItem *pItem)
bool IsAnyDatabaseFieldInDoc() const
bool HasChildWindow(sal_uInt16)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void ToggleInsModeOnActiveSidebarWin()
static void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
bool IsCursorVisible() const
void DisableItem(sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
#define FN_SPELL_GRAMMAR_DIALOG
Rect covering the pages area.
static void CalculateNonBlankPages(const SwRootFrame &rLayout, sal_uInt16 &nDocPageCount, sal_uInt16 &nActualPage)
#define FN_SET_BLOCK_MODE
constexpr tools::Long Height() const
void SetValueSet(SvxZoomEnableFlags nValues)
sal_uInt16 GetPhyPageNum() const
#define STR_SW_EVENT_PAGE_COUNT
const SwViewOption * GetViewOptions() const
#define FN_REDLINE_NEXT_CHANGE
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
virtual bool ReInitDlg(SwDocShell *pDocSh) override
... page will be formatted if required.
tools::Long AdjustWidth(tools::Long n)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
const INetURLObject & GetURLObject() const
OUString GetPassword() const
sal_uInt16 GetZoom() const
void Execute(SfxRequest &)
size_t IsObjSelected() const
virtual short run() override
Reference< XComponentContext > getProcessComponentContext()
const Point & GetPtPos() const
void SetOldGrfCat(const OUString &sStr)
#define FN_FORMAT_PAGE_DLG
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
static OUString GetEventName(sal_Int32 nId)
void ShowChildWindow(sal_uInt16, bool bVisible=true)
const char cSequenceMarkSeparator
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
const std::u16string_view aStringList[]
#define ERR_SWG_READ_ERROR
#define SID_INSPECTOR_DECK
void InsFrameMode(sal_uInt16 nCols)
static SVL_DLLPUBLIC bool CompareHashPassword(const css::uno::Sequence< sal_Int8 > &rOldPassHash, const OUString &sNewPass)
sal_uInt32 GetValue() const
static GraphicFilter & GetGraphicFilter()
SAL_DLLPRIVATE bool InsertGraphicDlg(SfxRequest &)
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(97)
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
void AppendItem(const SfxPoolItem &)
#define SAL_WARN(area, stream)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
const SdrHdlList & GetHdlList() const
virtual bool ImportFrom(SfxMedium &rMedium, css::uno::Reference< css::text::XTextRange > const &xInsertPosition)
void SetOldTabCat(const OUString &sStr)
sal_uInt16 GetPageNumber(const Point &rPoint) const
Page number of the page containing Point, O if no page.
virtual VclPtr< VclAbstractDialog > CreateVclSwViewDialog(SwView &rView)=0
SectionType GetType() const
int GetCurrentParaOutlineLevel() const
Get Outline level of current paragraph.
virtual const SwRedlineTable & GetRedlineTable() const =0
const SwFrameFormats * GetFrameFormats() const
SfxFilterContainer * GetFilterContainer() const
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
static FlyMode GetFrameMode()
SelectionType GetSelectionType() const
constexpr OUStringLiteral first
#define FN_INSERT_MULTI_TOX
#define FN_REDLINE_REJECT_DIRECT
void ExecuteFormLetter(SwWrtShell &rSh, const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
static constexpr size_type npos
OUString const & GetName() const
#define FN_REDLINE_ACCEPT
bool IsFrameSelected() const
sal_uInt16 GetViewLayoutColumns() const
void SetOldDrwCat(const OUString &sStr)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
OUString SfxResId(const char *pId)
bool IsOutlineRule() const
static void lcl_SetAllTextToDefaultLanguage(SwWrtShell &rWrtSh, sal_uInt16 nWhichId)
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
sal_uInt16 GetGapBetweenPages() const
void UnlockPaint(bool bVirDev=false)
const OUString & GetTOXName() const
void EndAction(const bool bIdleEnd=false)
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SfxMedium * GetMedium() const
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)
static OUString decode(OUString const &rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)