20#include <config_features.h>
21#include <config_fuzzers.h>
23#include <com/sun/star/util/SearchAlgorithms2.hpp>
26#include <com/sun/star/sdb/DatabaseContext.hpp>
27#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
28#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
29#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
30#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp>
31#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
32#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
33#include <com/sun/star/linguistic2/XDictionary.hpp>
35#include <officecfg/Office/Common.hxx>
105#include <section.hxx>
110#include <sfx2/strings.hrc>
112#include <strings.hrc>
114#include <globals.hrc>
127#include <LibreOfficeKit/LibreOfficeKitEnums.h>
142#include <osl/diagnose.h>
147#include <viewimp.hxx>
151#include <string_view>
180 std::unique_ptr<weld::Label> m_xLabel1;
181 std::unique_ptr<weld::SpinButton> m_xSpinButton;
182 std::unique_ptr<weld::Label> m_xLabel2;
187 SwNumberInputDlg(
weld::Window* pParent,
const OUString& rTitle,
188 const OUString& rLabel1,
const sal_Int64
nValue,
const sal_Int64
min,
const sal_Int64
max,
189 OUString rLabel2 = OUString())
191 , m_xLabel1(m_xBuilder->weld_label(
"label1"))
192 , m_xSpinButton(m_xBuilder->weld_spin_button(
"spinbutton"))
193 , m_xLabel2(m_xBuilder->weld_label(
"label2"))
197 m_xLabel1->set_label(rLabel1);
198 m_xSpinButton->set_value(
nValue);
199 m_xSpinButton->set_range(
min,
max);
200 m_xSpinButton->set_position(-1);
201 m_xSpinButton->select_region(0, -1);
202 m_xSpinButton->connect_changed(
LINK(
this, SwNumberInputDlg, InputModifiedHdl));
203 if (!rLabel2.isEmpty())
205 m_xLabel2->set_label(rLabel2);
212 return m_xSpinButton->get_text().toInt32();
218 m_xOKButton->set_sensitive(!m_xSpinButton->get_text().isEmpty());
222 auto nValue = m_xSpinButton->get_text().toInt32();
223 if (nValue <= m_xSpinButton->get_min())
224 m_xSpinButton->set_value(m_xSpinButton->get_min());
225 else if (
nValue > m_xSpinButton->get_max())
226 m_xSpinButton->set_value(m_xSpinButton->get_max());
228 m_xSpinButton->set_value(
nValue);
230 m_xSpinButton->set_position(-1);
272 if (!rPgStr.isEmpty() && std::u16string_view(OUString::number(nPhyNum)) != rPgStr)
274 else if (nPhyNum != nVirtNum)
275 extra = OUString::number(nVirtNum);
278 sal_uInt16 nPrintedPhyNum = nPhyNum;
279 sal_uInt16 nPrintedPageCount = nPageCount;
280 if (!
GetWrtShell().getIDocumentDeviceAccess().getPrintData().IsPrintEmptyPages())
283 OUString
aStr( nPageCount != nPrintedPageCount
284 ?
SwResId(STR_PAGE_COUNT_PRINTED)
285 : (extra.isEmpty() ?
SwResId(STR_PAGE_COUNT) :
SwResId(STR_PAGE_COUNT_CUSTOM)));
286 aStr =
aStr.replaceFirst(
"%1", OUString::number(nPhyNum));
287 aStr =
aStr.replaceFirst(
"%2", OUString::number(nPageCount));
288 if (nPageCount != nPrintedPageCount)
290 aStr =
aStr.replaceFirst(
"%3", OUString::number(nPrintedPhyNum));
291 aStr =
aStr.replaceFirst(
"%4", OUString::number(nPrintedPageCount));
294 aStr =
aStr.replaceFirst(
"%3", extra);
315 if ( aMetadata.
read(aGraphic) )
321 aTransform.
rotate( aRotation );
335 bLink ? rPath : OUString(),
336 bLink ? rFilter : OUString(),
353 rShell.
InsertGraphic( sURL, rFilter, aGraphic, &aFrameManager );
357 rShell.
InsertGraphic( OUString(), OUString(), aGraphic, &aFrameManager );
369 bool bReturn =
false;
373 OUString sGraphicFormat =
SwResId(STR_POOLFRM_GRAPHIC);
377#if HAVE_FEATURE_DESKTOP
381 ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE,
383 pFileDlg->SetTitle(
SwResId(STR_INSERT_GRAPHIC ));
384 pFileDlg->SetContext( FileDialogHelper::WriterInsertImage );
386 uno::Reference < XFilePicker3 > xFP = pFileDlg->GetFilePicker();
387 uno::Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
390 xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0,
Any(
true));
391 xCtrlAcc->enableControl( ExtendedFilePickerElementIds::CHECKBOX_LINK,
false);
394 std::vector<OUString> aFormats;
396 for(
size_t i = 0;
i < nArrLen; ++
i )
401 aFormats.push_back(pFormat->
GetName());
406 const std::vector<OUString>& rFramePoolArr(
408 for(
const auto &
i : rFramePoolArr)
410 aFormats.push_back(
i);
413 std::sort(aFormats.begin(), aFormats.end());
414 aFormats.erase(std::unique(aFormats.begin(), aFormats.end()), aFormats.end());
416 Sequence<OUString> aListBoxEntries(aFormats.size());
417 OUString* pEntries = aListBoxEntries.getArray();
418 sal_Int16 nSelect = 0;
419 for(
size_t i = 0;
i < aFormats.size(); ++
i )
421 pEntries[
i] = aFormats[
i];
422 if(pEntries[
i] == sGraphicFormat)
429 xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
430 ListboxControlActions::ADD_ITEMS , aTemplates );
433 xCtrlAcc->setValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
434 ListboxControlActions::SET_SELECT_ITEM, aSelectPos );
438 OSL_FAIL(
"control access failed");
443 bool bShowError = !
pName;
445#
if HAVE_FEATURE_DESKTOP
451 OUString aFileName, aFilterName;
454 aFileName =
pName->GetValue();
459#if HAVE_FEATURE_DESKTOP
462 aFileName = pFileDlg->GetPath();
463 aFilterName = pFileDlg->GetCurrentFilter();
467 bool bAsLink =
false;
474 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
475 OSL_ENSURE(aVal.hasValue(),
"Value CBX_INSERT_AS_LINK not found");
476 bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
477 Any aTemplateValue = xCtrlAcc->getValue(
478 ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
479 ListboxControlActions::GET_SELECTED_ITEM );
481 aTemplateValue >>= sTmpl;
486 OSL_FAIL(
"control access failed");
495 bool bAsLink =
false;
497#if HAVE_FEATURE_DESKTOP
506 if ( pStyle && !pStyle->GetValue().isEmpty() )
507 sGraphicFormat = pStyle->GetValue();
511 Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
512 OSL_ENSURE(aVal.hasValue(),
"Value CBX_INSERT_AS_LINK not found");
513 bAsLink = !aVal.hasValue() || *o3tl::doAccess<bool>(aVal);
514 Any aTemplateValue = xCtrlAcc->getValue(
515 ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE,
516 ListboxControlActions::GET_SELECTED_ITEM );
518 aTemplateValue >>= sTmpl;
519 if( !sTmpl.isEmpty() )
520 sGraphicFormat = sTmpl;
529 if (aWarnDlg.run() !=
RET_OK)
567 pResId = STR_GRFILTER_OPENERROR;
569 pResId = STR_GRFILTER_IOERROR;
571 pResId = STR_GRFILTER_FORMATERROR;
573 pResId = STR_GRFILTER_VERSIONERROR;
575 pResId = STR_GRFILTER_FILTERERROR;
577 pResId = STR_GRFILTER_TOOBIG;
586 VclMessageType::Info, VclButtonsType::Ok,
608 const sal_uInt16 nSlot = rReq.
GetSlot();
611 bool bIgnore =
false;
614 case SID_CREATE_SW_DRAWVIEW:
615 m_pWrtShell->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
624 pDlg->StartExecuteAsync(aContext);
630 case SID_REFRESH_VIEW:
637 case FN_PAGEDOWN_SEL:
641 if (
FN_PAGEUP == nSlot || FN_PAGEUP_SEL == nSlot )
655 sal_uInt16 nFact =
m_pWrtShell->GetViewOptions()->GetZoom();
656 if (SID_ZOOM_IN == nSlot)
660 SetZoom(SvxZoomType::PERCENT, nFact);
666 sal_uInt16 nPage = 0;
677 sal_uInt16 nOldPage(nPage);
680 else if (
FN_TO_NEXT_PAGE == nSlot && nPage < m_pWrtShell->GetPageCount())
682 if (nPage != nOldPage)
692 if(aPt.Y() != aAlPt.Y())
732 pCursor =
m_pWrtShell->SwCursorShell::GetCursor_();
741 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
745 if( aPasswd.hasElements() )
747 OSL_ENSURE( !
static_cast<const SfxBoolItem*
>(pItem)->
GetValue(),
"SwView::Execute(): password set and redlining off doesn't match!" );
753 (void)aPasswdDlg.
run();
757 bool bPasswordOk =
false;
758 if (aPasswd.getLength() == 1 && aPasswd[0] == 1)
762 const css::uno::Sequence< css::beans::PropertyValue > aDocumentProtection =
764 GetDocumentProtectionFromGrabBag();
769 !aDocumentProtection.hasElements() ||
787 VclMessageType::Info, VclButtonsType::Ok,
788 SfxResId(RID_SVXSTR_INCORRECT_PASSWORD)));
800 pViewFrame->GetBindings().Invalidate(FN_REDLINE_ON);
801 pViewFrame->GetBindings().Update(FN_REDLINE_ON);
806 case FN_REDLINE_PROTECT :
810 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem )
818 if (!aPasswd.hasElements())
819 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
820 if (aPasswdDlg.
run())
824 Sequence <sal_Int8> aNewPasswd =
827 if(!aPasswd.hasElements())
847 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem))
854 if (
m_pWrtShell->GetViewOptions()->IsShowChangesInMargin() &&
855 m_pWrtShell->GetViewOptions()->IsShowChangesInMargin2() )
859 m_pWrtShell->GetLayout()->SetHideRedlines( !bShow );
878 if (pArgs && pArgs->
GetItemState(nSlot,
false, &pItem) == SfxItemState::SET)
883 if (nChangeId == rRedlineTable[
i]->
GetId())
895 if ( bTableSelection )
904 if ( bTableSelection )
905 rSh.
EndUndo( eUndoId, &aRewriter);
919 if (nRedline < rRedlineTable.
size())
920 pRedline = rRedlineTable[nRedline];
926 bool bTableChange =
false;
932 if ( RedlineType::None != pTabLine->GetRedlineType() )
944 rRedlineTable[nRedline]->GetType() == RedlineType::Delete
945 ? STR_REDLINE_TABLE_ROW_DELETE
946 : STR_REDLINE_TABLE_ROW_INSERT ));
956 pRedline = rRedlineTable[nRedline];
960 if ( !pTableBox || pTableBox->
GetUpper() != pTabLine )
968 rSh.
EndUndo( eUndoId, &aRewriter);
974 assert(pRedline !=
nullptr);
977 if (pRedline && !bTableChange)
1000 if (pArgs && pArgs->
GetItemState(nSlot,
false, &pItem) == SfxItemState::SET)
1005 if (nChangeId == rRedlineTable[
i]->
GetId())
1011 if (nRedline < rRedlineTable.
size())
1020 OString aPayload(
".uno:CurrentTrackedChangeId=");
1021 sal_uInt32 nRedlineId = pNext->
GetId();
1022 aPayload += OString::number(nRedlineId);
1040 OString aPayload(
".uno:CurrentTrackedChangeId=");
1041 sal_uInt32 nRedlineId = pPrev->
GetId();
1042 aPayload += OString::number(nRedlineId);
1051 case SID_DOCUMENT_COMPARE:
1052 case SID_DOCUMENT_MERGE:
1054 OUString sFileName, sFilterName;
1056 bool bHasFileName =
false;
1058 bool bNoAcceptDialog =
false;
1063 sFileName = pFileItem->GetValue();
1064 bHasFileName = !sFileName.isEmpty();
1067 sFilterName = pFilterNameItem->GetValue();
1071 nVersion = pVersionItem->GetValue();
1076 bNoAcceptDialog = pDialogItem->GetValue();
1087 if (nFound > 0 && !bNoAcceptDialog)
1093 const sal_uInt16
nId = SwRedlineAcceptChild::GetChildWindowId();
1117 AttrChangedNotify(
nullptr);
1132 Point aPt(LONG_MIN, LONG_MIN);
1139 AttrChangedNotify(
nullptr);
1167 SfxCallMode::RECORD, { &aItem });
1172 case SID_ATTR_BORDER_INNER:
1173 case SID_ATTR_BORDER_OUTER:
1174 case SID_ATTR_BORDER_SHADOW:
1180 case SID_ATTR_PAGE_SIZE:
1181 case SID_ATTR_PAGE_MAXSIZE:
1182 case SID_ATTR_PAGE_PAPERBIN:
1183 case SID_ATTR_PAGE_EXT1:
1188 const size_t nCurIdx =
m_pWrtShell->GetCurPageDesc();
1215 const bool bWasLocked =
m_pWrtShell->IsViewLocked();
1231 bool bOldCursorInReadOnly =
m_pWrtShell->IsReadOnlyAvailable();
1234 for(
int i = 0;
i < 2; ++
i )
1250 bool bAutoMarkApplied =
false;
1256 bAutoMarkApplied =
true;
1267 m_pWrtShell->SetReadOnlyAvailable( bOldCursorInReadOnly );
1271 case SID_ATTR_BRUSH:
1275 const size_t nCurIdx =
m_pWrtShell->GetCurPageDesc();
1283 case SID_CLEARHISTORY:
1293#if defined(_WIN32) || defined UNX
1294 case SID_TWAIN_SELECT:
1295 case SID_TWAIN_TRANSFER:
1300 case SID_ATTR_DEFTABSTOP:
1303 if(pArgs && (pTabStopItem = pArgs->
GetItemIfSet(SID_ATTR_DEFTABSTOP,
false)))
1306 const sal_uInt16 nTab = pTabStopItem->
GetValue();
1312 case SID_ATTR_LANGUAGE :
1315 if(pArgs && (pLangItem = pArgs->
GetItemIfSet(SID_ATTR_LANGUAGE,
false)))
1323 case SID_ATTR_CHAR_CTL_LANGUAGE:
1330 case SID_ATTR_CHAR_CJK_LANGUAGE:
1340 int nOutlineLevel = -1;
1345 SwResId(STR_OUTLINE_LEVELS_SHOWN_TITLE),
1346 SwResId(STR_OUTLINE_LEVELS_SHOWN_SPIN_LABEL),
1347 nOutlineLevel + 1, 1, 10,
1348 SwResId(STR_OUTLINE_LEVELS_SHOWN_HELP_LABEL));
1349 if (aDlg.run() ==
RET_OK)
1374 bool *pbNext =
new bool(
true);
1377 MoveNavigationHdl(pbNext);
1380 case SID_JUMPTOMARK:
1381 if( pArgs && SfxItemState::SET == pArgs->
GetItemState(SID_JUMPTOMARK,
false, &pItem))
1392 case SID_AVMEDIA_PLAYER :
1395 case SID_VIEW_DATA_SOURCE_BROWSER:
1410 SfxItemState::SET == pArgs->
GetItemState(nSlot,
false, &pItem ))
1416#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
1425 AttrChangedNotify(
nullptr);
1443 bool bUseCurrentDocument =
true;
1444 bool bQuery = !pArgs || SfxItemState::SET != pArgs->
GetItemState(nSlot);
1450 if (
RET_OK == pDlg->Execute())
1451 bUseCurrentDocument = pDlg->IsThisDocument();
1458 case SID_RECHECK_DOCUMENT:
1462 uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( pDoc->
GetGCIterator() );
1463 if( xGCIterator.is() )
1465 xGCIterator->resetIgnoreRules();
1471 if( xDictionary.is() )
1472 xDictionary->clear();
1480 if (rReq.
GetArgs() !=
nullptr)
1491 case SID_ALIGN_ANY_LEFT :
1492 case SID_ALIGN_ANY_HCENTER :
1493 case SID_ALIGN_ANY_RIGHT :
1494 case SID_ALIGN_ANY_JUSTIFIED:
1495 case SID_ALIGN_ANY_TOP :
1496 case SID_ALIGN_ANY_VCENTER :
1497 case SID_ALIGN_ANY_BOTTOM :
1498 case SID_ALIGN_ANY_HDEFAULT :
1499 case SID_ALIGN_ANY_VDEFAULT :
1501 sal_uInt16 nAlias = 0;
1506 case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT;
break;
1507 case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER;
break;
1508 case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT;
break;
1509 case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK;
break;
1510 case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE;
break;
1511 case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER;
break;
1512 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM;
break;
1519 case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ;
break;
1520 case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ;
break;
1521 case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ;
break;
1522 case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ;
break;
1523 case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ;
break;
1524 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ;
break;
1530 nAlias, SfxCallMode::ASYNCHRON);
1533 case SID_RESTORE_EDITING_VIEW:
1538 if(
m_pViewImpl->GetRestorePosition(aCursorPos, bSelectObj))
1540 m_pWrtShell->SwCursorShell::SetCursor( aCursorPos, !bSelectObj );
1549 case SID_INSERT_GRAPHIC:
1554 case SID_MOVE_SHAPE_HANDLE:
1556 if (pArgs && pArgs->
Count() >= 3)
1559 if (pSdrView ==
nullptr)
1567 const sal_uLong newPosX = newPosXTwips->GetValue();
1568 const sal_uLong newPosY = newPosYTwips->GetValue();
1569 const Point mPoint(newPosX, newPosY);
1576 if (handle->
GetKind() == SdrHdlKind::Anchor || handle->
GetKind() == SdrHdlKind::Anchor_TR)
1579 pSdrView->
MoveShapeHandle(handleNum, mPoint, OrdNum ? OrdNum->GetValue() : -1);
1585 OSL_ENSURE(
false,
"wrong dispatcher");
1627 OSL_ENSURE( nWhich,
"empty set");
1633 const OUString& sCurrentSectionName = CurrSect->
GetSectionName();
1661 m_pWrtShell->GetFirstLastVisPageNumbers(aVisiblePageNumbers);
1664 OUString sFirstPhy = OUString::number(aVisiblePageNumbers.
nFirstPhy);
1665 OUString sLastPhy = OUString::number(aVisiblePageNumbers.
nLastPhy);
1666 OUString sFirstVirt = OUString::number(aVisiblePageNumbers.
nFirstVirt);
1667 OUString sLastVirt = OUString::number(aVisiblePageNumbers.
nLastVirt);
1672 OUString sPageCount = OUString::number(
m_pWrtShell->GetPageCount());
1676 aTooltip =
SwResId(STR_BOOKCTRL_HINT);
1679 if (sFirstPhy == sFirstCustomPhy && sLastPhy == sLastCustomPhy)
1681 aPageStr =
SwResId(STR_PAGES_COUNT);
1682 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1683 aPageStr = aPageStr.replaceFirst(
"%2", sLastPhy);
1684 aPageStr = aPageStr.replaceFirst(
"%3", sPageCount);
1688 aPageStr =
SwResId(STR_PAGES_COUNT_CUSTOM);
1689 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1690 aPageStr = aPageStr.replaceFirst(
"%2", sLastPhy);
1691 aPageStr = aPageStr.replaceFirst(
"%3", sFirstCustomPhy);
1692 aPageStr = aPageStr.replaceFirst(
"%4", sLastCustomPhy);
1693 aPageStr = aPageStr.replaceFirst(
"%5", sPageCount);
1698 if (sFirstPhy == sFirstCustomPhy && sLastPhy == sLastCustomPhy)
1700 aPageStr =
SwResId(STR_PAGE_COUNT);
1701 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1702 aPageStr = aPageStr.replaceFirst(
"%2", sPageCount);
1706 aPageStr =
SwResId(STR_PAGE_COUNT_CUSTOM);
1707 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1708 aPageStr = aPageStr.replaceFirst(
"%2", sFirstCustomPhy);
1709 aPageStr = aPageStr.replaceFirst(
"%3", sPageCount);
1715 aTooltip =
SwResId(STR_BOOKCTRL_HINT_EXTENDED);
1718 if (sFirstPhy == sFirstCustomPhy && sLastPhy == sLastCustomPhy)
1720 aPageStr =
SwResId(STR_PAGES_COUNT_EXTENDED);
1721 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1722 aPageStr = aPageStr.replaceFirst(
"%2", sLastPhy);
1723 aPageStr = aPageStr.replaceFirst(
"%3", sPageCount);
1724 aPageStr = aPageStr.replaceFirst(
"%4", sFirstVirt);
1725 aPageStr = aPageStr.replaceFirst(
"%5", sLastVirt);
1729 aPageStr =
SwResId(STR_PAGES_COUNT_CUSTOM_EXTENDED);
1730 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1731 aPageStr = aPageStr.replaceFirst(
"%2", sLastPhy);
1732 aPageStr = aPageStr.replaceFirst(
"%3", sFirstCustomPhy);
1733 aPageStr = aPageStr.replaceFirst(
"%4", sLastCustomPhy);
1734 aPageStr = aPageStr.replaceFirst(
"%5", sPageCount);
1735 aPageStr = aPageStr.replaceFirst(
"%6", sFirstVirt);
1736 aPageStr = aPageStr.replaceFirst(
"%7", sLastVirt);
1737 aPageStr = aPageStr.replaceFirst(
"%8", sFirstCustomVirt);
1738 aPageStr = aPageStr.replaceFirst(
"%9", sLastCustomVirt);
1743 if (sFirstPhy == sFirstCustomPhy && sLastPhy == sLastCustomPhy)
1745 aPageStr =
SwResId(STR_PAGE_COUNT_EXTENDED);
1746 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1747 aPageStr = aPageStr.replaceFirst(
"%2", sPageCount);
1748 aPageStr = aPageStr.replaceFirst(
"%3", sFirstVirt);
1752 aPageStr =
SwResId(STR_PAGE_COUNT_CUSTOM_EXTENDED);
1753 aPageStr = aPageStr.replaceFirst(
"%1", sFirstPhy);
1754 aPageStr = aPageStr.replaceFirst(
"%2", sFirstCustomPhy);
1755 aPageStr = aPageStr.replaceFirst(
"%3", sPageCount);
1756 aPageStr = aPageStr.replaceFirst(
"%4", sFirstVirt);
1757 aPageStr = aPageStr.replaceFirst(
"%5", sFirstCustomVirt);
1764 aPageStr = aPageStr.replaceAll(
"-",
SwResId(STR_PAGES_TWO_CONJUNCTION));
1799 TranslateId pResId = selectionStats.
nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION;
1800 TranslateNId pWordResId = selectionStats.
nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION;
1801 TranslateNId pCharResId = selectionStats.
nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION;
1804 OUString aWordArg =
SwResId(pWordResId, nWord).replaceAll(
"$1", rLocaleData.
getNum(nWord, 0));
1805 OUString aCharArg =
SwResId(pCharResId, nChar).replaceAll(
"$1", rLocaleData.
getNum(nChar, 0));
1806 OUString aWordCount(
SwResId(pResId));
1807 aWordCount = aWordCount.replaceAll(
"$1", aWordArg);
1808 aWordCount = aWordCount.replaceAll(
"$2", aCharArg);
1814 pWrdCnt->
SetCounts(selectionStats, documentStats);
1820 if (rOnlineAccessibilityCheck)
1822 sal_Int32 nIssues = rOnlineAccessibilityCheck->getNumberOfAccessibilityIssues();
1846 SvxZoomEnableFlags::N50|
1847 SvxZoomEnableFlags::N75|
1848 SvxZoomEnableFlags::N100|
1849 SvxZoomEnableFlags::N150|
1850 SvxZoomEnableFlags::N200);
1858 case SID_ATTR_VIEWLAYOUT:
1860 if ( (
GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !
GetDocShell()->IsInPlaceActive() )
1872 case SID_ATTR_ZOOMSLIDER:
1874 if ( (
GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !
GetDocShell()->IsInPlaceActive() )
1877 const sal_uInt16 nCurrentZoom = pVOpt->
GetZoom();
1884 const bool bAutomaticViewLayout = 0 == nColumns;
1900 const MapMode aTmpMap( MapUnit::MapTwip );
1902 const Size aWindowSize(
GetEditWin().PixelToLogic( rEditSize, aTmpMap ) );
1911 nFac =
std::min( nFac, nVisPercent );
1918 if ( bAutomaticViewLayout )
1921 nFac = aWindowSize.
Width() * 100 / nTmpWidth;
1922 nFac =
std::min( nFac, nVisPercent );
1936 case SID_ATTR_POSITION:
1946 if ( nWhich == SID_ATTR_POSITION )
1956 case SID_TABLE_CELL:
1974 eCategory = StatusCategory::TableCell;
1981 switch( pCurrSect->
GetType() )
1990 eCategory = StatusCategory::TableOfContents;
1995 "Unknown kind of section" );
1997 eCategory = StatusCategory::Section;
2003 eCategory = StatusCategory::Section;
2010 const bool bOutlineNum = pNumRule && pNumRule->
IsOutlineRule();
2012 if (pNumRule && !bOutlineNum )
2021 if(SfxItemState::DEFAULT <=
2024 const OUString& rNumStyle =
2026 if(!rNumStyle.isEmpty())
2030 if (eCategory == StatusCategory::NONE)
2031 eCategory = StatusCategory::ListStyle;
2036 if (!sStr.isEmpty())
2038 sStr +=
SwResId(STR_NUM_LEVEL) + OUString::number( nNumLevel + 1 );
2039 if (eCategory == StatusCategory::NONE)
2040 eCategory = StatusCategory::Numbering;
2044 if( nOutlineLevel != 0 )
2046 if (!sStr.isEmpty())
2050 sStr +=
SwResId(STR_OUTLINE_NUMBERING) +
2054 sStr +=
SwResId(STR_NUM_OUTLINE);
2055 sStr += OUString::number( nOutlineLevel);
2056 if (eCategory == StatusCategory::NONE)
2057 eCategory = StatusCategory::Numbering;
2062 if (!sStr.isEmpty())
2064 sStr =
SwResId(SW_STR_READONLY) + sStr;
2066 if (!sStr.isEmpty())
2082 case SID_ATTR_INSERT:
2105 sal_uInt16 nWhich = rReq.
GetSlot();
2111 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
2118 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
2125 if (SfxItemState::SET == pArgs->
GetItemState( nWhich,
true, &pItem))
2129 if(nIdx < pMarkAccess->getBookmarksCount())
2136 OSL_FAIL(
"SwView::ExecuteStatusLine(..)"
2137 " - Ignoring out of range bookmark index");
2145 css::uno::Any aAny(pDialogParent->
GetXWindow());
2148 pInternalItems[ 0 ] = &aDialogParent;
2149 pInternalItems[ 1 ] =
nullptr;
2151 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
2152 nullptr, 0, pInternalItems);
2157 if ( (
GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !
GetDocShell()->IsInPlaceActive() )
2173 SvxZoomEnableFlags::N50|
2174 SvxZoomEnableFlags::N75|
2175 SvxZoomEnableFlags::N100|
2176 SvxZoomEnableFlags::N150|
2177 SvxZoomEnableFlags::N200);
2179 aCoreSet.
Put( aZoom );
2184 aCoreSet.
Put( aViewLayout );
2191 pSet = pDlg->GetOutputItemSet();
2195 if ( pSet && (pViewLayoutItem = pSet->
GetItemIfSet(SID_ATTR_VIEWLAYOUT)))
2197 const sal_uInt16 nColumns = pViewLayoutItem->GetValue();
2198 const bool bBookMode = pViewLayoutItem->
IsBookMode();
2203 if ( pSet && (pZoomItem = pSet->
GetItemIfSet(SID_ATTR_ZOOM)))
2216 case SID_ATTR_VIEWLAYOUT:
2219 ( (
GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !
GetDocShell()->IsInPlaceActive() ) )
2223 const sal_uInt16 nColumns = pLayoutItem->GetValue();
2224 const bool bBookMode = (0 != nColumns && 0 == (nColumns % 2)) && pLayoutItem->IsBookMode();
2237 case SID_ATTR_ZOOMSLIDER:
2239 if ( pArgs && ( (
GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !
GetDocShell()->IsInPlaceActive() ) )
2243 const sal_uInt16 nCurrentZoom = pZoomItem->GetValue();
2244 SetZoom( SvxZoomType::PERCENT, nCurrentZoom );
2278 nId = SID_ATTR_TRANSFORM;
2282 SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
2290 if (SfxItemState::SET == pArgs->
GetItemState( nWhich,
true, &pItem))
2319 case SID_ATTR_INSERT:
2366 bool bWeb =
dynamic_cast<SwWebView*
>( this ) !=
nullptr;
2375 -> std::optional<std::pair<SwTOXMark, sal_Int32>>
2378 if (
first == std::u16string_view::npos)
2380 SAL_WARN(
"sw.ui",
"JumpToTOXMark: missing separator");
2381 return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2386 SAL_WARN(
"sw.ui",
"JumpToTOXMark: invalid counter");
2387 return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2390 if (second == std::u16string_view::npos)
2392 SAL_WARN(
"sw.ui",
"JumpToTOXMark: missing separator");
2393 return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2395 std::u16string_view
const entry(
aName.substr(
first + 1, second - (
first + 1)));
2396 if (
aName.size() < second + 2)
2398 SAL_WARN(
"sw.ui",
"JumpToTOXMark: invalid tox");
2399 return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2401 sal_uInt16
const indexType(
aName[second + 1]);
2402 std::u16string_view
const indexName(
aName.substr(second + 2));
2415 for (
auto i = rDoc.GetTOXTypeCount(
TOX_USER); 0 <
i; )
2418 auto const pTmp(rDoc.GetTOXType(
TOX_USER,
i));
2419 if (pTmp->GetTypeName() == indexName)
2429 SAL_WARN(
"sw.ui",
"JumpToTOXMark: tox doesn't exist");
2430 return std::optional<std::pair<SwTOXMark, sal_Int32>>();
2435 return std::optional<std::pair<SwTOXMark, sal_Int32>>(std::pair<SwTOXMark, sal_Int32>(tmp, counter));
2442 std::optional<std::pair<SwTOXMark, sal_Int32>>
const tmp(
2450 if (&tmp->first != &rSh.GetDoc()->GotoTOXMark(tmp->first,
TOX_SAME_NXT, rSh.IsReadOnlyAvailable()))
2452 for (sal_Int32
i = 0;
i < tmp->second; ++
i)
2460 SAL_WARN(
"sw.ui",
"JumpToTOXMark: tox mark doesn't exist");
2468 if( !rMark.empty() )
2493 sCmp = sMark.copy(
nPos + 1).replaceAll(
" ",
"");
2495 if( !sCmp.isEmpty() )
2497 OUString
sName( sMark.copy( 0,
nPos ) );
2498 sCmp = sCmp.toAsciiLowerCase();
2501 if (sCmp ==
"drawingobject")
2503 else if( sCmp ==
"region" )
2508 else if( sCmp ==
"outline" )
2513 else if( sCmp ==
"frame" )
2515 else if( sCmp ==
"graphic" )
2517 else if( sCmp ==
"ole" )
2519 else if( sCmp ==
"table" )
2524 else if( sCmp ==
"sequence" )
2535 else if (sCmp ==
"toxmark")
2539 else if( sCmp ==
"text" )
2545 SearchAlgorithms_ABSOLUTE, 0,
2549 TransliterationFlags::IGNORE_CASE,
2550 SearchAlgorithms2::ABSOLUTE,
2564 else if(
nullptr != ( pINet =
m_pWrtShell->FindINetAttr( sMark ) )) {
2590 else if(
nullptr != ( pINet =
m_pWrtShell->FindINetAttr( sMark ) ))
2617 for(
size_t i = 0;
i < nCnt; ++
i )
2623 if( (pHeaderItem && pHeaderItem->
IsActive()) ||
2624 (pFooterItem && pFooterItem->
IsActive()) )
2634 const sal_uInt16 nSlot = rRequest.
GetSlot();
2642 OUString sFile, sFilter;
2647 bool bHasFileName = !sFile.isEmpty();
2660 std::unique_ptr<SfxMedium> pMed;
2663 if( !rFileName.isEmpty() )
2669 pMed.reset(
new SfxMedium(rFileName, StreamMode::READ,
nullptr,
nullptr ));
2671 pMed->UseInteractionHandler(
true );
2676 pMed->SetFilter( pFilter );
2679 pMed.reset(
new SfxMedium(rFileName, StreamMode::READ, pFilter,
nullptr));
2685 SwDocShell::Factory().GetFactoryName(),
2700 bool bInsert =
false, bCompare =
false;
2706 case SID_DOCUMENT_MERGE:
break;
2707 case SID_DOCUMENT_COMPARE: bCompare =
true;
break;
2708 case SID_INSERTDOC: bInsert =
true;
break;
2711 OSL_ENSURE(
false,
"unknown SlotId!" );
2718 uno::Reference< frame::XDispatchRecorder > xRecorder =
2720 if ( xRecorder.is() )
2724 if(pMedium->GetFilter())
2738 pMedium->Download();
2739 if( aRef.
is() && 1 < aRef->GetRefCount() )
2744 (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER) )
2746 size_t nUndoCheck = 0;
2748 if( pRead && pDocSh->
GetDoc() )
2759 nErrno = pRdr->Read( *pRead );
2768 nErrno = pDocSh->
ImportFrom(*pMedium, xInsertPosition)
2795 nFound = nErrno.
IsError() ? -1 : 0;
2823 if (!bCompare && !nFound)
2826 VclMessageType::Info, VclButtonsType::Ok,
2827 SwResId(STR_NO_MERGE_ENTRY)));
2830 if( nRet==2 && xDocSh.
is() )
2846#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
2850 bool lcl_NeedAdditionalDataSource(
const uno::Reference< XDatabaseContext >& _rDatasourceContext )
2852 Sequence < OUString > aNames = _rDatasourceContext->getElementNames();
2854 return ( !aNames.hasElements()
2855 || ( ( 1 == aNames.getLength() )
2856 && aNames.getConstArray()[0] ==
SW_MOD()->GetDBConfig()->GetBibliographySource().sDataSource
2866#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS
2867 (void) bUseCurrentDocument;
2869 if(bUseCurrentDocument)
2874 uno::Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
2875 uno::Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
2876 bool bCallAddressPilot =
false;
2877 if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2881 std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog(
"DataSourcesUnavailableDialog"));
2883 if (
RET_OK != xQuery->run())
2885 bCallAddressPilot =
true;
2892 if(
RET_OK == pConnectionsDlg->Execute())
2893 bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
2898 if(bCallAddressPilot)
2901 SID_ADDRESS_DATA_SOURCE, SfxCallMode::SYNCHRON);
2902 if ( lcl_NeedAdditionalDataSource( xDBContext ) )
2918 SfxCallMode::SYNCHRON, { &aOn });
2924 if(!
GetWrtShell().IsFieldDataSourceAvailable(sSource))
2927 std::unique_ptr<weld::MessageDialog> xWarning(xBuilder->weld_message_dialog(
"WarnDataSourceDialog"));
2928 OUString sTmp(xWarning->get_primary_text());
2929 xWarning->set_primary_text(sTmp.replaceFirst(
"%1", sSource));
2930 if (
RET_OK == xWarning->run())
2944 std::vector<OUString> aDBNameList;
2945 std::vector<OUString> aAllDBNames;
2947 if(!aDBNameList.empty())
2949 OUString sDBName(aDBNameList[0]);
2956 AttrChangedNotify(
nullptr);
2976 int nRet = aDocTemplDlg.
run();
2977 bool bNewWin =
false;
3003 std::unique_ptr<SfxMedium> pMed = m_pViewImpl->CreateMedium();
3007 VclMessageType::Info, VclButtonsType::Ok,
3008 SwResId(RID_SVXSTR_TXTFILTER_FILTERERROR)));
3013 const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot();
3014 tools::Long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() );
3016 if ( SID_INSERTDOC == nSlot )
3018 if ( m_pViewImpl->GetParam() == 0 )
3020 m_pViewImpl->GetRequest()->SetReturnValue(
SfxBoolItem( nSlot, nFound != -1 ) );
3021 m_pViewImpl->GetRequest()->Ignore();
3025 m_pViewImpl->GetRequest()->SetReturnValue(
SfxBoolItem( nSlot, nFound != -1 ) );
3026 m_pViewImpl->GetRequest()->Done();
3029 else if ( SID_DOCUMENT_COMPARE == nSlot || SID_DOCUMENT_MERGE == nSlot )
3031 m_pViewImpl->GetRequest()->SetReturnValue(
SfxInt32Item( nSlot, nFound ) );
3039 sal_uInt16
nId = SwRedlineAcceptChild::GetChildWindowId();
PropertiesInfo aProperties
SfxApplication * SfxGetpApp()
Reference< XExecutableDialog > m_xDialog
const LocaleDataWrapper & GetUILocaleDataWrapper() const
static const AllSettings & GetSettings()
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static bool IsHeadlessModeEnabled()
sal_uInt16 GetValue() const
sal_uInt32 GetValue() const
const OUString & GetValue() const
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
static GraphicFilter & GetGraphicFilter()
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
void setOriginURL(OUString const &rOriginURL)
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getBookmarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence the IBookmarks.
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
virtual int getOutlineLevel(const tSortedOutlineNodeList::size_type nIdx) const =0
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
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...
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
static css::uno::Reference< css::linguistic2::XDictionary > GetIgnoreAllList()
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
void disposeAndReset(reference_type *pBody)
SdrHdl * GetFocusHdl() const
SdrHdl * GetHdl(size_t nNum) const
SdrHdlKind GetKind() const
bool AreObjectsMarked() const
const SdrHdlList & GetHdlList() const
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
static SfxAbstractDialogFactory * Create()
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
weld::Window * GetTopWindow() const
void Update(sal_uInt16 nId)
void Invalidate(sal_uInt16 nId)
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
SfxDialogController(weld::Widget *pParent, const OUString &rUIFile, const OString &rDialogId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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 * >())
std::shared_ptr< const SfxFilter > GetFilter4FilterName(const OUString &rName, SfxFilterFlags nMust=SfxFilterFlags::NONE, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
OUString const & GetName() const
ErrCode GuessFilter(SfxMedium &rMedium, std::shared_ptr< const SfxFilter > &, SfxFilterFlags nMust=SfxFilterFlags::IMPORT, SfxFilterFlags nDont=SFX_FILTER_NOTINSTALLED) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
const INetURLObject & GetURLObject() const
SfxFilterContainer * GetFilterContainer() const
virtual bool ImportFrom(SfxMedium &rMedium, css::uno::Reference< css::text::XTextRange > const &xInsertPosition)
virtual SfxObjectFactory & GetFactory() const=0
SfxMedium * GetMedium() const
bool IsInPlaceActive() const
static ErrCode HandleFilter(SfxMedium *pMedium, SfxObjectShell const *pDoc)
OUString GetPassword() const
virtual short run() override
void SetMinLen(sal_uInt16 Len)
void ShowExtras(SfxShowExtras nExtras)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
const OUString & GetName() const
virtual bool IsConditionalFastCall(const SfxRequest &rReq)
SfxViewFrame * GetFrame() const
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
virtual short run() override
void ToggleChildWindow(sal_uInt16)
SfxBindings & GetBindings()
bool HasChildWindow(sal_uInt16)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SfxDispatcher * GetDispatcher()
SfxChildWindow * GetChildWindow(sal_uInt16)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
weld::Window * GetFrameWeld() const
void ShowChildWindow(sal_uInt16, bool bVisible=true)
void ChildWindowExecute(SfxRequest &)
weld::Window * GetFrameWeld() const
SfxViewFrame & GetViewFrame() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Get(const css::uno::Reference< css::frame::XController > &i_rController)
virtual SfxObjectShell * GetObjectShell() override
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
static SVL_DLLPUBLIC void GetHashPassword(css::uno::Sequence< sal_Int8 > &rPassHash, const char *pPass, sal_uInt32 nLen)
static SVL_DLLPUBLIC bool CompareHashPassword(const css::uno::Sequence< sal_Int8 > &rOldPassHash, std::u16string_view sNewPass)
virtual VclPtr< AbstractSvxZoomDialog > CreateSvxZoomDialog(weld::Window *pParent, const SfxItemSet &rCoreSet)=0
static SvxAbstractDialogFactory * Create()
tools::Long GetRight() const
tools::Long GetLeft() const
LanguageType GetLanguage() const
static void SetSearchLabel(const SearchLabel &rSL)
tools::Long GetWidth() const
void SetValueSet(SvxZoomEnableFlags nValues)
SvxZoomType GetType() const
void AddSnappingPoint(sal_Int32 nNew)
virtual VclPtr< AbstractMailMergeCreateFromDlg > CreateMailMergeCreateFromDlg(weld::Window *pParent)=0
virtual VclPtr< VclAbstractDialog > CreateVclSwViewDialog(SwView &rView)=0
virtual VclPtr< AbstractMailMergeFieldConnectionsDlg > CreateMailMergeFieldConnectionsDlg(weld::Window *pParent)=0
static SwAbstractDialogFactory * Create()
static void SetFrameMode_(FlyMode eMode)
static FlyMode GetFrameMode()
void ExtendedSelectAll(bool bFootnotes=true)
static void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection)
void Push()
store a copy of the current cursor on the cursor stack
OUString GetBoxNms() const
const SwTableNode * IsCursorInTable() const
static void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage)
static void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn)
void EndAction(const bool bIdleEnd=false)
SwOutlineNodes::size_type GetOutlinePos(sal_uInt8 nLevel=UCHAR_MAX, SwPaM *pPaM=nullptr)
search "outline position" before previous outline node at given level
bool HasReadonlySel(bool isReplace=false) const
void ExecuteFormLetter(SwWrtShell &rSh, const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
static OUString GetEventName(sal_Int32 nId)
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false) override
Reader * StartConvertFrom(SfxMedium &rMedium, SwReaderPtr &rpRdr, SwCursorShell const *pCursorSh=nullptr, SwPaM *pPaM=nullptr)
For inserting document.
SwDoc * GetDoc()
returns Doc. But be careful!
std::unique_ptr< sw::OnlineAccessibilityCheck > const & getOnlineAccessibilityCheck() const
SwFrameFormat * MakeFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom, bool bBroadcast=false, bool bAuto=true)
size_t GetPageDescCnt() const
void SpellItAgainSam(bool bInvalid, bool bOnlyWrong, bool bSmartTags)
Re-trigger spelling in the idle handler.
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
static void CalculateNonBlankPages(const SwRootFrame &rLayout, sal_uInt16 &nDocPageCount, sal_uInt16 &nActualPage)
::sw::DocumentRedlineManager const & GetDocumentRedlineManager() const
const SwFrameFormats * GetFrameFormats() const
css::uno::Reference< css::linguistic2::XProofreadingIterator > const & GetGCIterator() const
const SwFrameFormat * GetDfltFrameFormat() const
const SwPageDesc & GetPageDesc(const size_t i) const
IDocumentStatistics const & getIDocumentStatistics() const
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
void CountWords(SwDocStat &rStat) const
Count words in current selection.
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
SwFrameFormat * GetTableFormat()
const SwSection * GetCurrSection() const
bool IsAnyDatabaseFieldInDoc() const
sal_uInt8 GetNumLevel() const
int GetCurrentParaOutlineLevel() const
Get Outline level of current paragraph.
SwDBData const & GetDBData() const
Database information.
const SwNumRule * GetNumRuleAtCurrCursorPos() const
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void ResetAttr(const o3tl::sorted_vector< sal_uInt16 > &attrs=o3tl::sorted_vector< sal_uInt16 >(), SwPaM *pCursor=nullptr)
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.
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
void SetApplyTemplate(const SwApplyTemplate &)
Apply template.
void InsFrame(sal_uInt16 nCols)
Insert mode for frames.
void SetUseInputLanguage(bool bNew)
#i42732# display status of font size/name depending on either the input language or the selection pos...
void SetChainMode(bool bOn)
void ToggleOutlineContentVisibility(const size_t nOutlinePos, const bool bSubs)
Point GetAnchorObjDiff() const
Methods for status line.
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
bool IsFrameSelected() const
size_t IsObjSelected() const
void SetSize(const Size &rLSize)
void SetCol(const SwFormatCol &rCol)
const Size & GetSize() const
Base class of the Writer layout elements.
sal_uInt16 GetPhyPageNum() const
sal_uInt16 GetPageSelection() const
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
bool IsOutlineRule() const
static constexpr auto npos
PaM is Point and Mark: a selection of the document model.
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
SwFrameFormat & GetMaster()
void ToggleInsModeOnActiveSidebarWin()
tools::ULong GetSidebarWidth(bool bPx=false) const
tools::ULong GetSidebarBorderWidth(bool bPx=false) const
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Of course Writer needs its own rectangles.
void SSize(const Size &rNew)
virtual bool ReInitDlg(SwDocShell *pDocSh) override
static constexpr size_type npos
vector_type::size_type size_type
void AddRule(SwUndoArg eWhat, const OUString &rWith)
const OUString & GetSectionName() const
SectionType GetType() const
Represents the current text cursor of one opened edit window.
const Point & GetPtPos() const
const Point & GetMkPos() const
static const std::vector< OUString > & GetFrameFormatUINameArray()
const OUString & GetTOXName() const
void SetAlternativeText(const OUString &rAlt)
SwTableBox is one table cell in the document model.
SwRedlineTable::size_type UpdateTextChangesOnly(SwRedlineTable::size_type &rRedlinePos, bool bUpdateProperty=true) const
sal_uInt16 GetGapBetweenPages() const
bool IsViewLayoutBookMode() const
SvxZoomType GetZoomType() const
sal_uInt16 GetZoom() const
sal_uInt16 GetViewLayoutColumns() const
bool getBrowseMode() const
sal_uInt16 GetDocumentBorder() const
const SwViewOption * GetViewOptions() const
void UnlockPaint(bool bVirDev=false)
const IDocumentSettingAccess & getIDocumentSettingAccess() const
Provides access to the document setting interface.
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
const IDocumentOutlineNodes * getIDocumentOutlineNodesAccess() const
void ExecuteScan(SfxRequest &rReq)
SAL_DLLPRIVATE bool PageDownCursor(bool bSelect)
void ExecuteStatusLine(SfxRequest &)
execute method for the status line
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
tools::Long InsertDoc(sal_uInt16 nSlotId, const OUString &rFileName, const OUString &rFilterName, sal_Int16 nVersion=0)
void EditLinkDlg()
show "edit link" dialog
SwWrtShell & GetWrtShell() const
void SetCachedString(CachedStringID id, const OUString &sStr)
std::unique_ptr< SwView_Impl > m_pViewImpl
std::unique_ptr< SwWrtShell > m_pWrtShell
void SetOldDrwCat(const OUString &sStr)
void SetOldFrameCat(const OUString &sStr)
tools::Rectangle m_aVisArea
void ExecuteInsertDoc(SfxRequest &rRequest, const SfxPoolItem *pItem)
void Execute(SfxRequest &)
OUString GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString &rPgStr)
Create string for showing the page number in the statusbar.
void SetViewLayout(sal_uInt16 nColumns, bool bBookMode, bool bViewOnly=false)
const tools::Rectangle & GetVisArea() const
bool JumpToSwMark(std::u16string_view rMark)
OUString m_sOldSectionName
const OUString & GetOldGrfCat()
SwPostItMgr * GetPostItMgr()
SelectCycle m_aSelectCycle
void ExecuteScan(SfxRequest &rReq)
SelectionType m_nSelectionType
void GenerateFormLetter(bool bUseCurrentDocument)
bool m_bMakeSelectionVisible
SAL_DLLPRIVATE bool PageUpCursor(bool bSelect)
SwWrtShell * GetWrtShellPtr() const
SwDrawBase * GetDrawFuncPtr() const
void SetOldTabCat(const OUString &sStr)
const OUString & GetCachedString(CachedStringID id)
void SetOldGrfCat(const OUString &sStr)
const OUString & GetOldFrameCat()
void UpdatePageNums()
invalidate page numbering field
void SetCursorAtTop(bool bFlag, bool bCenter=false)
virtual bool IsConditionalFastCall(const SfxRequest &rReq) override
SwDocShell * GetDocShell()
SwView_Impl * GetViewImpl()
void StateStatusLine(SfxItemSet &)
get status of the status line
SAL_DLLPRIVATE bool InsertGraphicDlg(SfxRequest &)
const OUString & GetOldDrwCat()
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
void InsFrameMode(sal_uInt16 nCols)
void InvalidateRulerPos()
const OUString & GetOldTabCat()
SAL_DLLPRIVATE Point AlignToPixel(const Point &rPt) const
static void SetMoveType(sal_uInt16 nSet)
tools::Long InsertMedium(sal_uInt16 nSlotId, std::unique_ptr< SfxMedium > pMedium, sal_Int16 nVersion)
void SetZoom(SvxZoomType eZoomType, short nFactor=100, bool bViewOnly=false)
ErrCode InsertGraphic(const OUString &rPath, const OUString &rFilter, bool bLink, GraphicFilter *pFlt)
void SetCounts(const SwDocStat &rCurrCnt, const SwDocStat &rDocStat)
Used by the UI to modify the document model.
OUString const & GetCurPageStyle() const
void MakeOutlineLevelsVisible(const int nLevel)
bool GotoPage(sal_uInt16 nPage, bool bRecord)
void GotoMark(const ::sw::mark::IMark *const pMark)
SelectionType GetSelectionType() const
void InsertGraphic(const OUString &rPath, const OUString &rFilter, const Graphic &, SwFlyFrameAttrMgr *=nullptr, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA)
bool HasSelection() const
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
static bool IsModifyPasswordCorrect(std::u16string_view aPassword, const css::uno::Sequence< css::beans::PropertyValue > &aInfo)
static css::uno::Sequence< css::beans::PropertyValue > ConvertPasswordInfo(const css::uno::Sequence< css::beans::PropertyValue > &aInfo)
void HideAll(bool bDeletion)
Size GetOutputSizePixel() const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual css::uno::Reference< css::awt::XWindow > GetXWindow()=0
#define FN_SET_BLOCK_MODE
#define FN_REDLINE_ACCEPT_DIRECT
#define FN_OUTLINE_LEVELS_SHOWN
#define FN_FORMAT_FRAME_DLG
#define FN_STAT_WORDCOUNT
#define FN_EDIT_CURRENT_TOX
#define FN_REDLINE_REJECT_DIRECT
#define FN_FORMAT_TABLE_DLG
#define FN_LINE_NUMBERING_DLG
#define FN_NUMBER_BULLETS
#define FN_SELECTION_CYCLE
#define FN_REDLINE_NEXT_CHANGE
#define FN_REDLINE_PREV_CHANGE
#define FN_REDLINE_ACCEPT_TONEXT
#define FN_UPDATE_CUR_TOX
#define FN_WORDCOUNT_DIALOG
#define FN_STAT_ACCESSIBILITY_CHECK
#define FN_INSERT_FIELD_DATA_ONLY
#define FN_SPELL_GRAMMAR_DIALOG
#define FN_PARAM_FTN_INFO
#define FN_INSERT_MULTI_TOX
#define FN_FORMAT_PAGE_DLG
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
#define FN_REDLINE_REJECT_TONEXT
#define FN_REDLINE_ACCEPT
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
IMPL_LINK_NOARG(SwContentControlButton, PopupModeEndHdl, weld::Popover &, void)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
virtual SfxBindings & GetBindings() override
virtual sal_uInt32 GetId() const override
int SwFindDocShell(SfxObjectShellRef &xDocSh, SfxObjectShellLock &xLockRef, std::u16string_view 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...
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
@ PageCalc
... page will be formatted if required.
@ PagesArea
Rect covering the pages area.
#define ERRCODE_GRFILTER_OPENERROR
#define ERRCODE_GRFILTER_TOOBIG
#define ERRCODE_GRFILTER_FORMATERROR
#define ERRCODE_GRFILTER_FILTERERROR
#define ERRCODE_GRFILTER_IOERROR
#define ERRCODE_GRFILTER_VERSIONERROR
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
std::unique_ptr< weld::Button > m_xOKButton
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
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)
const LanguageTag & getLocale()
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
constexpr OUStringLiteral first
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Dialog to specify the properties of date form field.
auto PrepareJumpToTOXMark(SwDoc const &rDoc, std::u16string_view aName) -> std::optional< std::pair< SwTOXMark, sal_Int32 > >
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SFX2_DLLPUBLIC OUString SfxResId(TranslateId aId)
OUString sFirstCustomVirt
std::function< void(sal_Int32)> maEndDialogFn
#define ERR_SWG_READ_ERROR
#define STR_SW_EVENT_PAGE_COUNT
OUString SwResId(TranslateId aId)
sal_Unicode const toxMarkSeparator
separator for toxmarks: #<no>%19<text>%19<type><typename>|toxmark
const char cSequenceMarkSeparator
const sal_Unicode cMarkSeparator
constexpr sal_uInt8 MAXLEVEL
const std::u16string_view aStringList[]
IMPL_LINK(SwView, DialogClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, void)
const char sStatusDelim[]
static auto JumpToTOXMark(SwWrtShell &rSh, std::u16string_view aName) -> bool
static size_t lcl_PageDescWithHeader(const SwDoc &rDoc)
static void lcl_SetAllTextToDefaultLanguage(SwWrtShell &rWrtSh, sal_uInt16 nWhichId)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)