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>
139 #include <viewimp.hxx>
143 #include <string_view>
150 using namespace sfx2;
199 if (!rPgStr.isEmpty() && std::u16string_view(OUString::number(nPhyNum)) != rPgStr)
201 else if (nPhyNum != nVirtNum)
202 extra = OUString::number(nVirtNum);
204 sal_uInt16 nPageCount = GetWrtShell().GetPageCnt();
205 sal_uInt16 nPrintedPhyNum = nPhyNum;
206 sal_uInt16 nPrintedPageCount = nPageCount;
207 if (!GetWrtShell().getIDocumentDeviceAccess().getPrintData().IsPrintEmptyPages())
210 OUString
aStr( nPageCount != nPrintedPageCount
211 ?
SwResId(STR_PAGE_COUNT_PRINTED)
212 : (extra.isEmpty() ?
SwResId(STR_PAGE_COUNT) :
SwResId(STR_PAGE_COUNT_CUSTOM)));
213 aStr = aStr.replaceFirst(
"%1", OUString::number(nPhyNum));
214 aStr = aStr.replaceFirst(
"%2", OUString::number(nPageCount));
215 if (nPageCount != nPrintedPageCount)
217 aStr = aStr.replaceFirst(
"%3", OUString::number(nPrintedPhyNum));
218 aStr = aStr.replaceFirst(
"%4", OUString::number(nPrintedPageCount));
221 aStr = aStr.replaceFirst(
"%3", extra);
229 SwWait aWait( *GetDocShell(),
true );
242 if ( aMetadata.
read(aGraphic) )
248 aTransform.
rotate( aRotation );
262 bLink ? rPath : OUString(),
263 bLink ? rFilter : OUString(),
280 rShell.
Insert( sURL, rFilter, aGraphic, &aFrameManager );
284 rShell.
Insert( OUString(), OUString(), aGraphic, &aFrameManager );
296 bool bReturn =
false;
300 OUString sGraphicFormat =
SwResId(STR_POOLFRM_GRAPHIC);
304 #if HAVE_FEATURE_DESKTOP
308 ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE,
310 pFileDlg->SetTitle(
SwResId(STR_INSERT_GRAPHIC ));
313 uno::Reference < XFilePicker3 > xFP = pFileDlg->GetFilePicker();
314 uno::Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
317 xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0,
makeAny(
true));
318 xCtrlAcc->enableControl( ExtendedFilePickerElementIds::CHECKBOX_LINK,
false);
321 std::vector<OUString> aFormats;
323 for(
size_t i = 0;
i < nArrLen; ++
i )
328 aFormats.push_back(pFormat->
GetName());
333 const std::vector<OUString>& rFramePoolArr(
335 for(
const auto &
i : rFramePoolArr)
337 aFormats.push_back(
i);
340 std::sort(aFormats.begin(), aFormats.end());
341 aFormats.erase(std::unique(aFormats.begin(), aFormats.end()), aFormats.end());
344 OUString* pEntries = aListBoxEntries.getArray();
345 sal_Int16 nSelect = 0;
346 for(
size_t i = 0;
i < aFormats.size(); ++
i )
348 pEntries[
i] = aFormats[
i];
349 if(pEntries[
i] == sGraphicFormat)
354 Any aTemplates(&aListBoxEntries,
cppu::UnoType<decltype(aListBoxEntries)>::
get());
356 xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
357 ListboxControlActions::ADD_ITEMS , aTemplates );
360 xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
361 ListboxControlActions::SET_SELECT_ITEM, aSelectPos );
365 OSL_FAIL(
"control access failed");
370 bool bShowError = !pName;
372 #
if HAVE_FEATURE_DESKTOP
378 OUString aFileName, aFilterName;
386 #if HAVE_FEATURE_DESKTOP
389 aFileName = pFileDlg->GetPath();
390 aFilterName = pFileDlg->GetCurrentFilter();
394 bool bAsLink =
false;
395 if(nHtmlMode & HTMLMODE_ON)
401 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
402 OSL_ENSURE(aVal.hasValue(),
"Value CBX_INSERT_AS_LINK not found");
403 bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
404 Any aTemplateValue = xCtrlAcc->getValue(
405 ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
406 ListboxControlActions::GET_SELECTED_ITEM );
408 aTemplateValue >>= sTmpl;
413 OSL_FAIL(
"control access failed");
422 bool bAsLink =
false;
424 #if HAVE_FEATURE_DESKTOP
425 if( nHtmlMode & HTMLMODE_ON )
433 if ( pStyle && !pStyle->GetValue().isEmpty() )
434 sGraphicFormat = pStyle->GetValue();
438 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
439 OSL_ENSURE(aVal.hasValue(),
"Value CBX_INSERT_AS_LINK not found");
440 bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
441 Any aTemplateValue = xCtrlAcc->getValue(
442 ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
443 ListboxControlActions::GET_SELECTED_ITEM );
445 aTemplateValue >>= sTmpl;
446 if( !sTmpl.isEmpty() )
447 sGraphicFormat = sTmpl;
456 if (aWarnDlg.run() !=
RET_OK)
492 const char* pResId(
nullptr);
494 pResId = STR_GRFILTER_OPENERROR;
496 pResId = STR_GRFILTER_IOERROR;
498 pResId = STR_GRFILTER_FORMATERROR;
500 pResId = STR_GRFILTER_VERSIONERROR;
502 pResId = STR_GRFILTER_FILTERERROR;
504 pResId = STR_GRFILTER_TOOBIG;
513 VclMessageType::Info, VclButtonsType::Ok,
535 const sal_uInt16 nSlot = rReq.
GetSlot();
538 bool bIgnore =
false;
545 deckId =
"InspectorDeck";
549 case SID_CREATE_SW_DRAWVIEW:
550 m_pWrtShell->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
558 aContext.maEndDialogFn = [](sal_Int32){};
565 case SID_REFRESH_VIEW:
566 GetEditWin().Invalidate();
567 m_pWrtShell->Reformat();
572 case FN_PAGEDOWN_SEL:
576 if (
FN_PAGEUP == nSlot || FN_PAGEUP_SEL == nSlot )
577 PageUpCursor(FN_PAGEUP_SEL == nSlot);
579 PageDownCursor(FN_PAGEDOWN_SEL == nSlot);
582 aVis != GetVisArea()));
590 tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
591 if (SID_ZOOM_OUT == nSlot)
595 SetZoom(SvxZoomType::PERCENT, nFact);
601 sal_uInt16 nPage = 0;
602 if (m_pWrtShell->IsCursorVisible())
603 nPage = m_pWrtShell->GetCursor()->GetPageNum();
606 SwFrame* pPageFrame = m_pWrtShell->Imp()->GetFirstVisPage(m_pWrtShell->GetOut());
612 sal_uInt16 nOldPage(nPage);
615 else if (
FN_TO_NEXT_PAGE == nSlot && nPage < m_pWrtShell->GetPageCount())
617 if (nPage != nOldPage)
619 m_pWrtShell->LockPaint();
622 m_pWrtShell->EnterStdMode();
623 m_pWrtShell->GotoPage(nPage,
true);
625 const Point aPt(m_aVisArea.Left(), m_pWrtShell->GetPagePos(nPage).Y());
626 Point aAlPt(AlignToPixel(aPt));
627 if(aPt.Y() != aAlPt.Y())
628 aAlPt.AdjustY(3 * GetEditWin().PixelToLogic(
Size(0, 1)).
Height());
630 m_pWrtShell->UnlockPaint();
638 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
642 if( aPasswd.hasElements() )
644 OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->
GetValue(),
"SwView::Execute(): password set and redlining off doesn't match!" );
647 if (aPasswd.getLength() == 1 && aPasswd[0] == 1)
650 VclMessageType::Warning, VclButtonsType::YesNo,
651 SfxResId(RID_SVXSTR_END_REDLINING_WARNING)));
652 xWarn->set_default_response(
RET_NO);
683 pViewFrame->GetBindings().Invalidate(FN_REDLINE_ON);
684 pViewFrame->GetBindings().Update(FN_REDLINE_ON);
689 case FN_REDLINE_PROTECT :
693 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem )
701 if (!aPasswd.hasElements())
702 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
703 if (aPasswdDlg.
run())
707 Sequence <sal_Int8> aNewPasswd =
710 if(!aPasswd.hasElements())
720 m_pWrtShell->SetRedlineFlagsAndCheckInsMode( (nMode & ~
RedlineFlags::On) | nOn);
730 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem))
735 m_pWrtShell->StartAllAction();
737 if ( m_pWrtShell->GetViewOptions()->IsShowChangesInMargin() &&
738 m_pWrtShell->GetViewOptions()->IsShowChangesInMargin2() )
740 GetDocShell()->GetDoc()->GetDocumentRedlineManager().HideAll(!bShow);
742 m_pWrtShell->GetLayout()->SetHideRedlines( !bShow );
743 m_pWrtShell->EndAllAction();
744 if (m_pWrtShell->IsRedlineOn())
745 m_pWrtShell->SetInsMode();
750 GetViewFrame()->ToggleChildWindow(nSlot);
757 SwDoc *pDoc = m_pWrtShell->GetDoc();
758 SwPaM *pCursor = m_pWrtShell->GetCursor();
761 if (pArgs && pArgs->
GetItemState(nSlot,
false, &pItem) == SfxItemState::SET)
766 if (nChangeId == rRedlineTable[
i]->GetId())
774 m_pWrtShell->AcceptRedlinesInSelection();
776 m_pWrtShell->RejectRedlinesInSelection();
790 if (nRedline < rRedlineTable.
size())
791 pRedline = rRedlineTable[nRedline];
796 assert(pRedline !=
nullptr);
800 m_pWrtShell->AcceptRedline(nRedline);
802 m_pWrtShell->RejectRedline(nRedline);
817 SwDoc* pDoc = m_pWrtShell->GetDoc();
820 if (pArgs && pArgs->
GetItemState(nSlot,
false, &pItem) == SfxItemState::SET)
825 if (nChangeId == rRedlineTable[
i]->GetId())
831 if (nRedline < rRedlineTable.
size())
832 pNext = m_pWrtShell->GotoRedline(nRedline,
true);
834 pNext = m_pWrtShell->SelNextRedline();
840 OString aPayload(
".uno:CurrentTrackedChangeId=");
841 sal_uInt32 nRedlineId = pNext->
GetId();
842 aPayload += OString::number(nRedlineId);
843 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
846 m_pWrtShell->SetInSelect();
860 OString aPayload(
".uno:CurrentTrackedChangeId=");
861 sal_uInt32 nRedlineId = pPrev->
GetId();
862 aPayload += OString::number(nRedlineId);
863 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
866 m_pWrtShell->SetInSelect();
871 case SID_DOCUMENT_COMPARE:
872 case SID_DOCUMENT_MERGE:
874 OUString sFileName, sFilterName;
876 bool bHasFileName =
false;
877 m_pViewImpl->SetParam( 0 );
878 bool bNoAcceptDialog =
false;
882 if( SfxItemState::SET == pArgs->
GetItemState( SID_FILE_NAME,
false, &pItem ))
883 sFileName = static_cast<const SfxStringItem*>(pItem)->GetValue();
884 bHasFileName = !sFileName.isEmpty();
886 if( SfxItemState::SET == pArgs->
GetItemState( SID_FILTER_NAME,
false, &pItem ))
887 sFilterName = static_cast<const SfxStringItem*>(pItem)->GetValue();
889 if( SfxItemState::SET == pArgs->
GetItemState( SID_VERSION,
false, &pItem ))
892 m_pViewImpl->SetParam( nVersion );
894 if( SfxItemState::SET == pArgs->
GetItemState( SID_NO_ACCEPT_DIALOG,
false, &pItem ))
900 m_pViewImpl->InitRequest( rReq );
901 tools::Long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion );
907 if (nFound > 0 && !bNoAcceptDialog)
913 const sal_uInt16
nId = SwRedlineAcceptChild::GetChildWindowId();
925 GetViewFrame()->ShowChildWindow(nSlot);
929 if ( m_pWrtShell->HasDrawViewDrag() )
931 m_pWrtShell->BreakDrag();
932 m_pWrtShell->EnterSelFrameMode();
934 else if ( m_pWrtShell->IsDrawCreate() )
936 GetDrawFuncPtr()->BreakCreate();
937 AttrChangedNotify(
nullptr);
939 else if ( m_pWrtShell->HasSelection() || IsDrawMode() )
941 SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() :
nullptr;
952 Point aPt(LONG_MIN, LONG_MIN);
955 SfxBindings& rBind = GetViewFrame()->GetBindings();
958 m_pWrtShell->EnterStdMode();
959 AttrChangedNotify(
nullptr);
962 else if ( GetEditWin().GetApplyTemplate() )
966 else if( static_cast<SfxObjectShell*>(GetDocShell())->IsInPlaceActive() )
970 else if ( GetEditWin().IsChainMode() )
972 GetEditWin().SetChainMode(
false );
974 else if( m_pWrtShell->GetFlyFrameFormat() )
976 const SwFrameFormat* pFormat = m_pWrtShell->GetFlyFrameFormat();
979 m_pWrtShell->HideCursor();
980 m_pWrtShell->EnterSelFrameMode();
986 GetViewFrame()->GetDispatcher()->ExecuteList(SID_WIN_FULLSCREEN,
987 SfxCallMode::RECORD, { &aItem });
992 case SID_ATTR_BORDER_INNER:
993 case SID_ATTR_BORDER_OUTER:
994 case SID_ATTR_BORDER_SHADOW:
996 m_pWrtShell->SetAttrSet(*pArgs);
1000 case SID_ATTR_PAGE_SIZE:
1001 case SID_ATTR_PAGE_MAXSIZE:
1002 case SID_ATTR_PAGE_PAPERBIN:
1003 case SID_ATTR_PAGE_EXT1:
1008 const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
1009 SwPageDesc aPageDesc( m_pWrtShell->GetPageDesc( nCurIdx ) );
1012 m_pWrtShell->ChgPageDesc( nCurIdx, aPageDesc );
1025 GetViewFrame()->GetDispatcher()->Execute(
1031 const SwTOXBase* pBase = m_pWrtShell->GetCurTOX();
1035 const bool bWasLocked = m_pWrtShell->IsViewLocked();
1036 m_pWrtShell->LockView(
true);
1037 m_pWrtShell->StartAction();
1039 m_pWrtShell->ApplyAutoMark();
1040 m_pWrtShell->UpdateTableOf( *pBase );
1041 m_pWrtShell->EndAction();
1043 m_pWrtShell->LockView(
false);
1049 m_pWrtShell->StartAction();
1050 m_pWrtShell->EnterStdMode();
1051 bool bOldCursorInReadOnly = m_pWrtShell->IsReadOnlyAvailable();
1052 m_pWrtShell->SetReadOnlyAvailable(
true );
1054 for(
int i = 0;
i < 2; ++
i )
1056 if( m_pWrtShell->GetTOXCount() == 1 )
1059 while( m_pWrtShell->GotoPrevTOXBase() )
1063 const SwTOXBase* pBase = m_pWrtShell->GetCurTOX();
1066 m_pWrtShell->GotoNextTOXBase();
1067 pBase = m_pWrtShell->GetCurTOX();
1070 bool bAutoMarkApplied =
false;
1075 m_pWrtShell->ApplyAutoMark();
1076 bAutoMarkApplied =
true;
1079 m_pWrtShell->UpdateTableOf( *pBase );
1081 if( m_pWrtShell->GotoNextTOXBase() )
1082 pBase = m_pWrtShell->GetCurTOX();
1087 m_pWrtShell->SetReadOnlyAvailable( bOldCursorInReadOnly );
1088 m_pWrtShell->EndAction();
1091 case SID_ATTR_BRUSH:
1095 const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
1096 SwPageDesc aDesc( m_pWrtShell->GetPageDesc( nCurIdx ));
1099 m_pWrtShell->ChgPageDesc( nCurIdx, aDesc);
1103 case SID_CLEARHISTORY:
1105 m_pWrtShell->DelAllUndoObj();
1113 #if defined(_WIN32) || defined UNX
1114 case SID_TWAIN_SELECT:
1115 case SID_TWAIN_TRANSFER:
1116 GetViewImpl()->ExecuteScan( rReq );
1120 case SID_ATTR_DEFTABSTOP:
1122 if(pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_DEFTABSTOP,
false, &pItem))
1127 m_pWrtShell->SetDefault( aDefTabs );
1131 case SID_ATTR_LANGUAGE :
1132 if(pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_LANGUAGE,
false, &pItem))
1135 m_pWrtShell->SetDefault( aLang );
1139 case SID_ATTR_CHAR_CTL_LANGUAGE:
1142 m_pWrtShell->SetDefault( *pItem );
1146 case SID_ATTR_CHAR_CJK_LANGUAGE:
1149 m_pWrtShell->SetDefault( *pItem );
1155 m_pWrtShell->EnterStdMode();
1156 size_t nPos(m_pWrtShell->GetOutlinePos());
1157 m_pWrtShell->ToggleOutlineContentVisibility(
nPos);
1158 m_pWrtShell->GotoOutline(
nPos);
1169 bool *pbNext =
new bool(
true);
1172 MoveNavigationHdl(pbNext);
1175 case SID_JUMPTOMARK:
1176 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_JUMPTOMARK,
false, &pItem))
1177 JumpToSwMark( static_cast<const SfxStringItem*>(pItem)->GetValue() );
1181 GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
1185 GetViewFrame()->GetFrame().GetFrameInterface());
1187 case SID_AVMEDIA_PLAYER :
1188 GetViewFrame()->ChildWindowExecute(rReq);
1190 case SID_VIEW_DATA_SOURCE_BROWSER:
1205 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
1206 bShow = static_cast<const SfxBoolItem*>(pItem)->GetValue();
1207 if((bShow && m_bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot))
1208 GetViewFrame()->ToggleChildWindow(nSlot);
1211 #if HAVE_FEATURE_DBCONNECTIVITY
1220 AttrChangedNotify(
nullptr);
1223 PropertyValue*
pValues = aProperties.getArray();
1224 pValues[0].Name =
"DataSourceName";
1225 pValues[1].Name =
"Command";
1226 pValues[2].Name =
"CommandType";
1228 pValues[1].Value <<= aData.
sCommand;
1234 m_bInMailMerge &= bShow;
1240 bool bUseCurrentDocument =
true;
1241 bool bQuery = !pArgs || SfxItemState::SET != pArgs->
GetItemState(nSlot);
1252 GenerateFormLetter(bUseCurrentDocument);
1255 case SID_RECHECK_DOCUMENT:
1259 uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( pDoc->
GetGCIterator() );
1260 if( xGCIterator.is() )
1262 xGCIterator->resetIgnoreRules();
1268 if( xDictionary.is() )
1269 xDictionary->clear();
1271 m_pWrtShell->StartOfSection();
1277 if (rReq.
GetArgs() !=
nullptr)
1279 static_cast<const SfxBoolItem&>( (rReq.
GetArgs()->
1288 case SID_ALIGN_ANY_LEFT :
1289 case SID_ALIGN_ANY_HCENTER :
1290 case SID_ALIGN_ANY_RIGHT :
1291 case SID_ALIGN_ANY_JUSTIFIED:
1292 case SID_ALIGN_ANY_TOP :
1293 case SID_ALIGN_ANY_VCENTER :
1294 case SID_ALIGN_ANY_BOTTOM :
1295 case SID_ALIGN_ANY_HDEFAULT :
1296 case SID_ALIGN_ANY_VDEFAULT :
1298 sal_uInt16 nAlias = 0;
1303 case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT;
break;
1304 case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER;
break;
1305 case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT;
break;
1306 case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK;
break;
1307 case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE;
break;
1308 case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER;
break;
1309 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM;
break;
1316 case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ;
break;
1317 case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ;
break;
1318 case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ;
break;
1319 case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ;
break;
1320 case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ;
break;
1321 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ;
break;
1326 GetViewFrame()->GetDispatcher()->Execute(
1327 nAlias, SfxCallMode::ASYNCHRON);
1330 case SID_RESTORE_EDITING_VIEW:
1335 if(m_pViewImpl->GetRestorePosition(aCursorPos, bSelectObj))
1337 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1340 m_pWrtShell->SelectObj( aCursorPos );
1341 m_pWrtShell->EnterSelFrameMode( &aCursorPos );
1346 case SID_INSERT_GRAPHIC:
1353 OSL_ENSURE(
false,
"wrong dispatcher");
1377 SfxBindings &rBnd = GetViewFrame()->GetBindings();
1383 SfxBindings &rBnd = GetViewFrame()->GetBindings();
1395 OSL_ENSURE( nWhich,
"empty set");
1401 const OUString& sCurrentSectionName = CurrSect->
GetSectionName();
1402 if(sCurrentSectionName != m_sOldSectionName)
1406 m_sOldSectionName = sCurrentSectionName;
1408 else if (!m_sOldSectionName.isEmpty())
1411 m_sOldSectionName= OUString();
1425 sal_uInt16 nPage, nLogPage;
1429 aStringList.push_back(GetPageStr(nPage, nLogPage, sDisplay));
1430 bool bExtendedTooltip(!sDisplay.isEmpty() &&
1431 std::u16string_view(OUString::number(nPage)) != sDisplay &&
1433 OUString aTooltip = bExtendedTooltip ?
SwResId(STR_BOOKCTRL_HINT_EXTENDED)
1435 aStringList.push_back(aTooltip);
1438 if (m_nOldPageNum != nLogPage )
1440 if (m_nOldPageNum != 0)
1442 m_nOldPageNum = nLogPage;
1444 const sal_uInt16 nCnt = GetWrtShell().GetPageCnt();
1445 if (m_nPageCnt != nCnt)
1462 const char* pResId = selectionStats.
nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION;
1463 const char* pWordResId = selectionStats.
nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION;
1464 const char* pCharResId = selectionStats.
nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION;
1467 OUString aWordArg =
SwResId(pWordResId, nWord).replaceAll(
"$1", rLocaleData.
getNum(nWord, 0));
1468 OUString aCharArg =
SwResId(pCharResId, nChar).replaceAll(
"$1", rLocaleData.
getNum(nChar, 0));
1469 OUString aWordCount(
SwResId(pResId));
1470 aWordCount = aWordCount.replaceAll(
"$1", aWordArg);
1471 aWordCount = aWordCount.replaceAll(
"$2", aCharArg);
1477 pWrdCnt->
SetCounts(selectionStats, documentStats);
1490 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1499 SvxZoomEnableFlags::N50|
1500 SvxZoomEnableFlags::N75|
1501 SvxZoomEnableFlags::N100|
1502 SvxZoomEnableFlags::N150|
1503 SvxZoomEnableFlags::N200);
1511 case SID_ATTR_VIEWLAYOUT:
1513 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1519 rSet.
Put( aViewLayout );
1525 case SID_ATTR_ZOOMSLIDER:
1527 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1530 const sal_uInt16 nCurrentZoom = pVOpt->
GetZoom();
1537 const bool bAutomaticViewLayout = 0 == nColumns;
1546 Size aPageSize( aPageRect.SSize() );
1551 Size aRootSize( aRootRect.SSize() );
1553 const MapMode aTmpMap( MapUnit::MapTwip );
1554 const Size& rEditSize = GetEditWin().GetOutputSizePixel();
1555 const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
1558 tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width();
1560 aPageSize.AdjustHeight(nOf );
1564 nFac = std::min( nFac, nVisPercent );
1571 if ( bAutomaticViewLayout )
1574 nFac = aWindowSize.
Width() * 100 / nTmpWidth;
1575 nFac = std::min( nFac, nVisPercent );
1583 rSet.
Put( aZoomSliderItem );
1589 case SID_ATTR_POSITION:
1599 if ( nWhich == SID_ATTR_POSITION )
1609 case SID_TABLE_CELL:
1632 switch( pCurrSect->
GetType() )
1637 const SwTOXBase* pTOX = m_pWrtShell->GetCurTOX();
1643 "Unknown kind of section" );
1656 const bool bOutlineNum = pNumRule && pNumRule->
IsOutlineRule();
1658 if (pNumRule && !bOutlineNum )
1668 if(SfxItemState::DEFAULT <=
1671 const OUString& rNumStyle =
1673 if(!rNumStyle.isEmpty())
1681 if (!sStr.isEmpty())
1683 sStr +=
SwResId(STR_NUM_LEVEL) + OUString::number( nNumLevel + 1 );
1688 if( nOutlineLevel != 0 )
1690 if (!sStr.isEmpty())
1694 sStr +=
SwResId(STR_OUTLINE_NUMBERING) +
1698 sStr +=
SwResId(STR_NUM_OUTLINE);
1699 sStr += OUString::number( nOutlineLevel);
1704 if (!sStr.isEmpty())
1706 sStr =
SwResId(SW_STR_READONLY) + sStr;
1708 if (!sStr.isEmpty())
1724 case SID_ATTR_INSERT:
1747 sal_uInt16 nWhich = rReq.
GetSlot();
1752 GetViewFrame()->GetDispatcher()->Execute(
FN_GOTO_PAGE,
1753 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1760 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1767 if (SfxItemState::SET == pArgs->
GetItemState( nWhich,
true, &pItem))
1771 if(nIdx < pMarkAccess->getBookmarksCount())
1778 OSL_FAIL(
"SwView::ExecuteStatusLine(..)"
1779 " - Ignoring out of range bookmark index");
1787 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
1792 if ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() )
1808 SvxZoomEnableFlags::N50|
1809 SvxZoomEnableFlags::N75|
1810 SvxZoomEnableFlags::N100|
1811 SvxZoomEnableFlags::N150|
1812 SvxZoomEnableFlags::N200);
1814 aCoreSet.Put( aZoom );
1819 aCoreSet.Put( aViewLayout );
1830 if ( pSet && SfxItemState::SET == pSet->
GetItemState(SID_ATTR_VIEWLAYOUT,
true, &pViewLayoutItem))
1833 const bool bBookMode =
static_cast<const SvxViewLayoutItem *
>(pViewLayoutItem)->IsBookMode();
1834 SetViewLayout( nColumns, bBookMode );
1837 if ( pSet && SfxItemState::SET == pSet->
GetItemState(SID_ATTR_ZOOM,
true, &pItem))
1840 SetZoom( eType, static_cast<const SvxZoomItem *>(pItem)->
GetValue() );
1850 case SID_ATTR_VIEWLAYOUT:
1853 ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) )
1855 if ( SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_VIEWLAYOUT,
true, &pItem ))
1858 const bool bBookMode = (0 != nColumns && 0 == (nColumns % 2)) &&
1861 SetViewLayout( nColumns, bBookMode );
1867 InvalidateRulerPos();
1872 case SID_ATTR_ZOOMSLIDER:
1874 if ( pArgs && ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) )
1876 if ( SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_ZOOMSLIDER,
true, &pItem ))
1879 SetZoom( SvxZoomType::PERCENT, nCurrentZoom );
1913 nId = SID_ATTR_TRANSFORM;
1916 GetViewFrame()->GetDispatcher()->Execute(nId,
1917 SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
1925 if (SfxItemState::SET == pArgs->
GetItemState( nWhich,
true, &pItem))
1927 switch ( static_cast<const SfxUInt16Item *>(pItem)->GetValue() )
1972 case SID_ATTR_INSERT:
1986 SfxBindings &rBnd = GetViewFrame()->GetBindings();
1994 if ( m_pWrtShell->HasWholeTabSelection() )
1999 m_pWrtShell->
GetPageDesc(m_pWrtShell->GetCurPageDesc()).GetMaster();
2000 SwTwips lWidth = rPageFormat.GetFrameSize().GetWidth();
2003 aMgr.SetSize(
Size(lWidth, aMgr.GetSize().Height()));
2008 aMgr.SetCol( aCol );
2010 aMgr.InsertFlyFrame();
2013 GetEditWin().InsFrame(nCols);
2019 bool bWeb =
dynamic_cast<SwWebView*
>( this ) !=
nullptr;
2028 if( !rMark.isEmpty() )
2031 bool bSaveCC = m_bCenterCursor;
2032 bool bSaveCT = m_bTopCursor;
2033 SetCursorAtTop(
true );
2036 bool bHasShFocus = m_pWrtShell->HasShellFocus();
2038 m_pWrtShell->ShellGetFocus();
2047 while( -1 != ( nLastPos = sMark.indexOf(
cMarkSeparator, nPos + 1 )) )
2053 sCmp = sMark.copy(nPos + 1).replaceAll(
" ",
"");
2055 if( !sCmp.isEmpty() )
2057 OUString
sName( sMark.copy( 0, nPos ) );
2058 sCmp = sCmp.toAsciiLowerCase();
2061 if (sCmp ==
"drawingobject")
2062 bRet = m_pWrtShell->GotoDrawingObject(
sName);
2063 else if( sCmp ==
"region" )
2065 m_pWrtShell->EnterStdMode();
2066 bRet = m_pWrtShell->GotoRegion(
sName );
2068 else if( sCmp ==
"outline" )
2070 m_pWrtShell->EnterStdMode();
2071 bRet = m_pWrtShell->GotoOutline(
sName );
2073 else if( sCmp ==
"frame" )
2075 else if( sCmp ==
"graphic" )
2077 else if( sCmp ==
"ole" )
2079 else if( sCmp ==
"table" )
2081 m_pWrtShell->EnterStdMode();
2082 bRet = m_pWrtShell->GotoTable(
sName );
2084 else if( sCmp ==
"sequence" )
2086 m_pWrtShell->EnterStdMode();
2090 sal_uInt16 nSeqNo =
sName.copy( nNoPos + 1 ).toInt32();
2095 else if( sCmp ==
"text" )
2098 m_pWrtShell->EnterStdMode();
2101 SearchAlgorithms_ABSOLUTE, 0,
2105 TransliterationFlags::IGNORE_CASE,
2106 SearchAlgorithms2::ABSOLUTE,
2112 m_pWrtShell->EnterStdMode();
2118 bRet = m_pWrtShell->GotoMark( *ppMark,
false );
2120 else if(
nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) )) {
2121 m_pWrtShell->addCurrentPosition();
2132 m_pWrtShell->UnSelectFrame();
2133 m_pWrtShell->LeaveSelFrameMode();
2137 m_pWrtShell->HideCursor();
2138 m_pWrtShell->EnterSelFrameMode();
2144 bRet = m_pWrtShell->GotoMark( *ppMark,
false );
2146 else if(
nullptr != ( pINet = m_pWrtShell->FindINetAttr( sMark ) ))
2150 if ( m_aVisArea.IsEmpty() )
2151 m_bMakeSelectionVisible =
true;
2154 SetCursorAtTop( bSaveCT, bSaveCC );
2156 if(!m_pWrtShell->IsFrameSelected() && !m_pWrtShell->IsObjSelected())
2157 m_pWrtShell->ShowCursor();
2160 m_pWrtShell->ShellLoseFocus();
2173 for(
size_t i = 0;
i < nCnt; ++
i )
2189 m_pViewImpl->InitRequest( rRequest );
2190 m_pViewImpl->SetParam( pItem ? 1 : 0 );
2191 const sal_uInt16 nSlot = rRequest.
GetSlot();
2195 InsertDoc( nSlot,
"",
"" );
2199 OUString sFile, sFilter;
2202 sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue();
2204 bool bHasFileName = !sFile.isEmpty();
2205 tools::Long nFound = InsertDoc( nSlot, sFile, sFilter );
2217 std::unique_ptr<SfxMedium> pMed;
2220 if( !rFileName.isEmpty() )
2226 pMed.reset(
new SfxMedium(rFileName, StreamMode::READ,
nullptr,
nullptr ));
2228 pMed->UseInteractionHandler(
true );
2229 ErrCode nErr = aMatcher.GuessFilter(*pMed, pFilter, SfxFilterFlags::NONE);
2233 pMed->SetFilter( pFilter );
2236 pMed.reset(
new SfxMedium(rFileName, StreamMode::READ, pFilter,
nullptr));
2240 m_pViewImpl->StartDocumentInserter(
2242 SwDocShell::Factory().GetFactoryName(),
2252 return InsertMedium( nSlotId, std::move(pMed), nVersion );
2257 bool bInsert =
false, bCompare =
false;
2263 case SID_DOCUMENT_MERGE:
break;
2264 case SID_DOCUMENT_COMPARE: bCompare =
true;
break;
2265 case SID_INSERTDOC: bInsert =
true;
break;
2268 OSL_ENSURE(
false,
"unknown SlotId!" );
2275 uno::Reference< frame::XDispatchRecorder > xRecorder =
2276 GetViewFrame()->GetBindings().GetRecorder();
2277 if ( xRecorder.is() )
2279 SfxRequest aRequest(GetViewFrame(), SID_INSERTDOC);
2281 if(pMedium->GetFilter())
2295 pMedium->Download();
2296 if( aRef.
is() && 1 < aRef->GetRefCount() )
2301 (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER) )
2303 size_t nUndoCheck = 0;
2305 if( pRead && pDocSh->
GetDoc() )
2310 SwWait aWait( *GetDocShell(),
true );
2311 m_pWrtShell->StartAllAction();
2312 if ( m_pWrtShell->HasSelection() )
2313 m_pWrtShell->DelRight();
2316 nErrno = pRdr->Read( *pRead );
2322 uno::Reference<text::XTextRange>
const xInsertPosition(
2324 *m_pWrtShell->GetCursor()->GetPoint(),
nullptr));
2325 nErrno = pDocSh->
ImportFrom(*pMedium, xInsertPosition)
2332 if( m_pWrtShell->IsUpdateTOX() )
2336 m_pWrtShell->SetUpdateTOX(
false );
2348 m_pWrtShell->EndAllAction();
2352 nFound = nErrno.
IsError() ? -1 : 0;
2365 OUString(), nVersion, pDocSh );
2368 SwWait aWait( *GetDocShell(),
true );
2369 m_pWrtShell->StartAllAction();
2371 m_pWrtShell->EnterStdMode();
2374 nFound = m_pWrtShell->CompareDoc( *static_cast<SwDocShell*>( xDocSh.
get() )->GetDoc() );
2376 nFound = m_pWrtShell->MergeDoc( *static_cast<SwDocShell*>( xDocSh.
get() )->GetDoc() );
2378 m_pWrtShell->EndAllAction();
2380 if (!bCompare && !nFound)
2383 VclMessageType::Info, VclButtonsType::Ok,
2384 SwResId(STR_NO_MERGE_ENTRY)));
2387 if( nRet==2 && xDocSh.
is() )
2397 m_bInMailMerge =
true;
2398 SfxBindings& rBind = GetViewFrame()->GetBindings();
2403 #if HAVE_FEATURE_DBCONNECTIVITY
2407 bool lcl_NeedAdditionalDataSource(
const uno::Reference< XDatabaseContext >& _rDatasourceContext )
2411 return ( !aNames.hasElements()
2412 || ( ( 1 == aNames.getLength() )
2413 && aNames.getConstArray()[0] ==
SW_MOD()->GetDBConfig()->GetBibliographySource().sDataSource
2423 #if !HAVE_FEATURE_DBCONNECTIVITY
2424 (
void) bUseCurrentDocument;
2426 if(bUseCurrentDocument)
2428 if(!GetWrtShell().IsAnyDatabaseFieldInDoc())
2432 uno::Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
2433 bool bCallAddressPilot =
false;
2434 if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2438 std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog(
"DataSourcesUnavailableDialog"));
2440 if (
RET_OK != xQuery->run())
2442 bCallAddressPilot =
true;
2449 if(
RET_OK == pConnectionsDlg->Execute())
2450 bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
2455 if(bCallAddressPilot)
2457 GetViewFrame()->GetDispatcher()->Execute(
2458 SID_ADDRESS_DATA_SOURCE, SfxCallMode::SYNCHRON);
2459 if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2475 SfxCallMode::SYNCHRON, { &aOn });
2481 if(!GetWrtShell().IsFieldDataSourceAvailable(sSource))
2484 std::unique_ptr<weld::MessageDialog> xWarning(xBuilder->weld_message_dialog(
"WarnDataSourceDialog"));
2485 OUString sTmp(xWarning->get_primary_text());
2486 xWarning->set_primary_text(sTmp.replaceFirst(
"%1", sSource));
2487 if (
RET_OK == xWarning->run())
2496 SwDBManager* pDBManager = GetWrtShell().GetDBManager();
2501 std::vector<OUString> aDBNameList;
2502 std::vector<OUString> aAllDBNames;
2504 if(!aDBNameList.empty())
2506 OUString sDBName(aDBNameList[0]);
2513 AttrChangedNotify(
nullptr);
2518 PropertyValue*
pValues = aProperties.getArray();
2519 pValues[0].Name =
"DataSourceName";
2520 pValues[1].Name =
"Command";
2521 pValues[2].Name =
"CommandType";
2523 pValues[1].Value <<= aData.
sCommand;
2535 int nRet = aDocTemplDlg.
run();
2536 bool bNewWin =
false;
2560 std::unique_ptr<SfxMedium> pMed = m_pViewImpl->CreateMedium();
2564 VclMessageType::Info, VclButtonsType::Ok,
2565 SwResId(RID_SVXSTR_TXTFILTER_FILTERERROR)));
2570 const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot();
2571 tools::Long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() );
2573 if ( SID_INSERTDOC == nSlot )
2575 if ( m_pViewImpl->GetParam() == 0 )
2577 m_pViewImpl->GetRequest()->SetReturnValue(
SfxBoolItem( nSlot, nFound != -1 ) );
2578 m_pViewImpl->GetRequest()->Ignore();
2582 m_pViewImpl->GetRequest()->SetReturnValue(
SfxBoolItem( nSlot, nFound != -1 ) );
2583 m_pViewImpl->GetRequest()->Done();
2586 else if ( SID_DOCUMENT_COMPARE == nSlot || SID_DOCUMENT_MERGE == nSlot )
2588 m_pViewImpl->GetRequest()->SetReturnValue(
SfxInt32Item( nSlot, nFound ) );
2596 sal_uInt16
nId = SwRedlineAcceptChild::GetChildWindowId();
2607 m_pViewImpl->ExecuteScan(rReq) ;
2612 return GetCachedString(OldGrfCat);
2617 SetCachedString(OldGrfCat, sStr);
2622 return GetCachedString(OldTabCat);
2627 SetCachedString(OldTabCat, sStr);
2632 return GetCachedString(OldFrameCat);
2637 SetCachedString(OldFrameCat, sStr);
2642 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
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)
weld::Window * GetFrameWeld() const
#define FN_NUMBER_BULLETS
void disposeAndReset(reference_type *pBody)
void AddSnappingPoint(sal_Int32 nNew)
vcl::Window & GetWindow() const
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)
vcl::Window * GetTopWindow() const
#define FN_EDIT_CURRENT_TOX
virtual void DelAllUndoObj()=0
Delete all Undo actions.
#define FN_PARAM_FTN_INFO
Point GetAnchorObjDiff() const
Methods for status line.
const LocaleDataWrapper & GetUILocaleDataWrapper() const
#define ERRCODE_GRFILTER_OPENERROR
#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
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
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
const OUString & GetSectionName() const
void ChildWindowExecute(SfxRequest &)
bool IsViewLayoutBookMode() const
void EndAction(const bool bIdleEnd=false, const bool DoSetPosX=false)
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
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.
tools::Long Width() const
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.
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
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
#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
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)
tools::Long Height() const
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()
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)
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 &)
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
#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
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)