37#include <osl/diagnose.h>
57#include <bitmaps.hlst>
61#include <svx/dialogs.hrc>
70OUString BuildBitmap(
bool bProtect,
bool bHidden)
73 return bHidden ? OUString(RID_BMP_PROT_HIDE) : OUString(RID_BMP_PROT_NO_HIDE);
74 return bHidden ? OUString(RID_BMP_HIDE) : OUString(RID_BMP_NO_HIDE);
77OUString CollapseWhiteSpaces(std::u16string_view sName)
79 const sal_Int32 nLen =
sName.size();
81 OUStringBuffer
aBuf(nLen);
82 for (sal_Int32 i = 0;
i<nLen; )
88 while (i<nLen && sName[i]==cRef)
91 return aBuf.makeStringAndClear();
124 if( !aTmpArr.empty() )
127 for(
const auto pSect : aTmpArr )
154 const ::sw::mark::IMark* pBkmk = *ppMark;
155 if( pBkmk->IsExpanded() )
194 void SetFile(std::u16string_view rFile);
195 void SetFilter(std::u16string_view rFilter);
210 : m_SectionData( rSect )
215 , m_bContent(m_SectionData.GetLinkFileName().isEmpty())
238 if( !rFile.empty() || !sSub.empty() )
249 if( !rFile.empty() || !sSub.empty() )
270 else if( !sSub.empty() )
275 if( !sNewFile.isEmpty() )
289 if( !rSubRegion.empty() || !sOldFileName.empty() )
295 if( !rSubRegion.empty() || !sOldFileName.empty() )
309 if( sLinkFile.isEmpty() )
326 if( !sLinkFile.isEmpty() )
335 , m_bSubRegionsFilled(false)
337 , m_bDontCheckPasswd(true)
338 , m_xCurName(m_xBuilder->weld_entry(
"curname"))
339 , m_xTree(m_xBuilder->weld_tree_view(
"tree"))
340 , m_xFileCB(m_xBuilder->weld_check_button(
"link"))
341 , m_xDDECB(m_xBuilder->weld_check_button(
"dde"))
342 , m_xDDEFrame(m_xBuilder->weld_widget(
"ddedepend"))
343 , m_xFileNameFT(m_xBuilder->weld_label(
"filenameft"))
344 , m_xDDECommandFT(m_xBuilder->weld_label(
"ddeft"))
345 , m_xFileNameED(m_xBuilder->weld_entry(
"filename"))
346 , m_xFilePB(m_xBuilder->weld_button(
"file"))
347 , m_xSubRegionFT(m_xBuilder->weld_label(
"sectionft"))
348 , m_xSubRegionED(m_xBuilder->weld_combo_box(
"section"))
349 , m_xProtectCB(m_xBuilder->weld_check_button(
"protect"))
350 , m_xPasswdCB(m_xBuilder->weld_check_button(
"withpassword"))
351 , m_xPasswdPB(m_xBuilder->weld_button(
"password"))
352 , m_xHideCB(m_xBuilder->weld_check_button(
"hide"))
353 , m_xConditionFT(m_xBuilder->weld_label(
"conditionft"))
354 , m_xConditionED(new
ConditionEdit(m_xBuilder->weld_entry(
"condition")))
355 , m_xEditInReadonlyCB(m_xBuilder->weld_check_button(
"editinro"))
356 , m_xOK(m_xBuilder->weld_button(
"ok"))
357 , m_xOptionsPB(m_xBuilder->weld_button(
"options"))
358 , m_xDismiss(m_xBuilder->weld_button(
"remove"))
359 , m_xHideFrame(m_xBuilder->weld_widget(
"hideframe"))
391 m_xTree->set_selection_mode(SelectionMode::Multiple);
406 if (!
m_xTree->get_selected(
nullptr))
408 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
409 if (
m_xTree->get_iter_first(*xIter))
433 if (aPasswdDlg.
run())
435 const OUString sNewPasswd(aPasswdDlg.
GetPassword());
436 css::uno::Sequence <sal_Int8 > aNewPasswd;
447 VclMessageType::Info, VclButtonsType::Ok,
468 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
486 m_xTree->insert(
nullptr, -1, &sText, &
sId,
nullptr,
nullptr,
false, xIter.get());
487 m_xTree->set_image(*xIter, sImage);
490 if (
m_xTree->iter_has_child(*xIter))
495 m_xTree->scroll_to_row(*xIter);
505 for(
const auto pSect : aTmpArr )
508 pFormat = pSect->GetFormat();
516 OUString sText(pSect->GetSectionName());
517 OUString sImage = BuildBitmap(pSect->IsProtect(), pSect->IsHidden());
519 m_xTree->insert(pEntry, -1, &sText, &
sId,
nullptr,
nullptr,
false, xIter.get());
520 m_xTree->set_image(*xIter, sImage);
523 if (
m_xTree->iter_has_child(*xIter))
528 m_xTree->scroll_to_row(*xIter);
543 OSL_FAIL(
"SectionFormat not on the list" );
549 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
550 if (
m_xTree->get_iter_first(*xIter))
554 delete weld::fromId<SectRepr*>(
m_xTree->get_id(*xIter));
555 }
while (
m_xTree->iter_next(*xIter));
561 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
562 if (!
m_xTree->get_iter_first(*xIter))
572 m_xTree->scroll_to_row(*xIter);
576 }
while (
m_xTree->iter_next(*xIter));
583 m_bDontCheckPasswd =
true;
584 std::unique_ptr<weld::TreeIter> xIter(rBox.make_iterator());
585 bool bEntry = rBox.get_selected(xIter.get());
586 m_xHideCB->set_sensitive(
true);
588 m_xEditInReadonlyCB->set_sensitive(
true);
590 m_xProtectCB->set_sensitive(
true);
591 m_xFileCB->set_sensitive(
true);
592 css::uno::Sequence <sal_Int8> aCurPasswd;
593 if (1 < rBox.count_selected_rows())
601 bool bHiddenValid =
true;
602 bool bProtectValid =
true;
603 bool bConditionValid =
true;
605 bool bEditInReadonlyValid =
true;
606 bool bEditInReadonly =
true;
609 bool bProtect =
true;
612 bool bFileValid =
true;
614 bool bPasswdValid =
true;
617 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
633 bConditionValid =
false;
634 bHiddenValid = (bHidden == rData.
IsHidden());
637 bEditInReadonlyValid =
640 bFileValid = (bFile ==
642 bPasswdValid = (aCurPasswd == rData.
GetPassword());
653 m_xEditInReadonlyCB->set_state(!bEditInReadonlyValid ?
TRISTATE_INDET :
660 m_xConditionED->set_text(sCondition);
663 m_xConditionFT->set_sensitive(
false);
664 m_xConditionED->set_sensitive(
false);
667 m_xCurName->set_sensitive(
false);
668 m_xDDECB->set_sensitive(
false);
669 m_xDDEFrame->set_sensitive(
false);
670 m_xOptionsPB->set_sensitive(
false);
671 bool bPasswdEnabled = m_xProtectCB->get_state() ==
TRISTATE_TRUE;
672 m_xPasswdCB->set_sensitive(bPasswdEnabled);
673 m_xPasswdPB->set_sensitive(bPasswdEnabled);
676 rBox.get_selected(xIter.get());
679 GetFirstEntryHdl(rBox);
683 m_xPasswdCB->set_active(aCurPasswd.hasElements());
687 m_xCurName->set_sensitive(
true);
688 m_xOptionsPB->set_sensitive(
true);
689 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xIter));
692 m_xHideCB->set_sensitive(
true);
695 m_xConditionED->set_sensitive(bHide);
696 m_xConditionFT->set_sensitive(bHide);
697 m_xPasswdCB->set_active(rData.
GetPassword().hasElements());
699 m_xOK->set_sensitive(
true);
700 m_xPasswdCB->set_sensitive(
true);
701 m_xCurName->set_text(rBox.get_text(*xIter));
702 m_xCurName->set_sensitive(
true);
703 m_xDismiss->set_sensitive(
true);
704 const OUString aFile = pRepr->
GetFile();
706 m_xSubRegionED->clear();
707 m_xSubRegionED->append_text(
"");
708 m_bSubRegionsFilled =
false;
709 if( !aFile.isEmpty() || !sSub.isEmpty() )
711 m_xFileCB->set_active(
true);
712 m_xFileNameED->set_text(aFile);
713 m_xSubRegionED->set_entry_text(sSub);
718 m_xFileCB->set_active(
false);
719 m_xFileNameED->set_text(aFile);
720 m_xDDECB->set_sensitive(
false);
721 m_xDDECB->set_active(
false);
723 UseFileHdl(*m_xFileCB);
727 m_xProtectCB->set_sensitive(
true);
732 m_xEditInReadonlyCB->set_sensitive(
true);
734 bool bPasswdEnabled = m_xProtectCB->get_active();
735 m_xPasswdCB->set_sensitive(bPasswdEnabled);
736 m_xPasswdPB->set_sensitive(bPasswdEnabled);
738 m_bDontCheckPasswd =
false;
754 m_rSh.StartAllAction();
756 m_rSh.ResetSelect(
nullptr,
false );
758 std::unique_ptr<weld::TreeIter> xIter(m_xTree->make_iterator());
759 if (m_xTree->get_iter_first(*xIter))
763 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xIter));
769 size_t nNewPos = rDocFormats.
GetPos(pFormat);
770 if ( SIZE_MAX != nNewPos )
772 std::unique_ptr<SfxItemSet> pSet(pFormat->
GetAttrSet().
Clone(
false ));
774 pSet->Put( pRepr->
GetCol() );
796 pSet->Count() ? pSet.get() :
nullptr );
798 }
while (m_xTree->iter_next(*xIter));
801 for (SectReprs_t::reverse_iterator it = m_SectReprs.rbegin(), aEnd = m_SectReprs.rend(); it != aEnd; ++it)
803 assert(it->first == it->second->GetArrPos());
805 const size_t nNewPos = rDocFormats.
GetPos( pFormat );
806 if( SIZE_MAX != nNewPos )
807 m_rSh.DelSectionFormat( nNewPos );
817 m_rSh.EndAllAction();
823 if (!CheckPasswd(&rButton))
827 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
829 OUString aImage = BuildBitmap(bCheck,
TRISTATE_TRUE == m_xHideCB->get_state());
830 m_xTree->set_image(rEntry, aImage);
833 m_xPasswdCB->set_sensitive(bCheck);
834 m_xPasswdPB->set_sensitive(bCheck);
840 if (!CheckPasswd(&rButton))
842 m_xTree->selected_foreach([
this, &rButton](
weld::TreeIter& rEntry){
843 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
845 OUString aImage = BuildBitmap(
TRISTATE_TRUE == m_xProtectCB->get_state(),
847 m_xTree->set_image(rEntry, aImage);
851 m_xConditionED->set_sensitive(bHide);
852 m_xConditionFT->set_sensitive(bHide);
858 if (!CheckPasswd(&rButton))
860 m_xTree->selected_foreach([
this, &rButton](
weld::TreeIter& rEntry){
861 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
875 SectRepr*
const pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
880 std::unique_ptr<weld::TreeIter> xEntry(m_xTree->make_iterator());
881 bool bEntry(m_xTree->get_selected(xEntry.get()));
885 SectRepr*
const pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xEntry));
886 std::unique_ptr<weld::TreeIter> xRemove;
887 bool bRestart =
false;
890 m_SectReprs.insert(std::make_pair(pSectRepr->
GetArrPos(),
891 std::unique_ptr<SectRepr>(pSectRepr)));
892 if (m_xTree->iter_has_child(*xEntry))
894 std::unique_ptr<weld::TreeIter> xChild(m_xTree->make_iterator(xEntry.get()));
895 (void)m_xTree->iter_children(*xChild);
896 std::unique_ptr<weld::TreeIter> xParent(m_xTree->make_iterator(xEntry.get()));
897 if (!m_xTree->iter_parent(*xParent))
904 std::unique_ptr<weld::TreeIter> xMove(m_xTree->make_iterator(xChild.get()));
905 bChild = m_xTree->iter_next_sibling(*xChild);
906 m_xTree->move_subtree(*xMove, xParent.get(), m_xTree->get_iter_index_in_parent(*xEntry));
909 xRemove = m_xTree->make_iterator(xEntry.get());
912 bEntry = m_xTree->get_iter_first(*xEntry);
914 bEntry = m_xTree->iter_next(*xEntry);
916 m_xTree->remove(*xRemove);
919 if (m_xTree->get_selected(
nullptr))
922 m_xConditionFT->set_sensitive(
false);
923 m_xConditionED->set_sensitive(
false);
924 m_xDismiss->set_sensitive(
false);
925 m_xCurName->set_sensitive(
false);
926 m_xProtectCB->set_sensitive(
false);
927 m_xPasswdCB->set_sensitive(
false);
928 m_xHideCB->set_sensitive(
false);
930 m_xEditInReadonlyCB->set_sensitive(
false);
933 m_xPasswdCB->set_active(
false);
935 m_xFileCB->set_active(
false);
938 UseFileHdl(*m_xFileCB);
944 if (!CheckPasswd(&rButton))
946 bool bMulti = 1 < m_xTree->count_selected_rows();
947 bool bFile = rButton.get_active();
948 if (m_xTree->get_selected(
nullptr))
951 SectRepr*
const pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
953 if( rButton.get_active() && bContent && m_rSh.HasSelection() )
956 VclMessageType::Question, VclButtonsType::YesNo,
958 if (
RET_NO == xQueryBox->run())
959 rButton.set_active(
false );
971 m_xDDECB->set_sensitive(bFile && !bMulti);
972 m_xDDEFrame->set_sensitive(bFile && !bMulti);
976 m_xFileNameED->grab_focus();
981 m_xDDECB->set_active(
false);
982 m_xSubRegionED->set_entry_text(OUString());
988 rButton.set_active(
false);
989 rButton.set_sensitive(
false);
990 m_xDDECB->set_active(
false);
991 m_xDDECB->set_sensitive(
false);
992 m_xDDEFrame->set_sensitive(
false);
1001 m_pDocInserter.reset(new ::sfx2::DocumentInserter(
m_xDialog.get(),
"swriter"));
1009 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1020 SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE> aSet( m_rSh.GetView().GetPool() );
1022 aSet.Put( pSectRepr->
GetCol() );
1034 tools::Long nWidth = m_rSh.GetSectionWidth(*pFormat);
1047 if( !(pOutSet && pOutSet->
Count()) )
1076 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
1078 pRepr->
GetCol() = *pColItem;
1088 pRepr->
GetFrameDir()->SetValue(pFrameDirItem->GetValue());
1097 int nStartPos, nEndPos;
1098 rEdit.get_entry_selection_bounds(nStartPos, nEndPos);
1101 rEdit.select_entry_region(nStartPos, nEndPos);
1102 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1109 int nStartPos, nEndPos;
1110 rEdit.get_selection_bounds(nStartPos, nEndPos);
1113 rEdit.select_region(nStartPos, nEndPos);
1114 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1115 m_xSubRegionED->clear();
1116 m_xSubRegionED->append_text(
"");
1117 m_bSubRegionsFilled =
false;
1118 if (m_xDDECB->get_active())
1120 OUString sLink( CollapseWhiteSpaces(rEdit.get_text()) );
1133 OUString sTmp(rEdit.get_text());
1136 SfxMedium* pMedium = m_rSh.GetView().GetDocShell()->GetMedium();
1150 if (!CheckPasswd(&rButton))
1152 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1156 bool bFile = m_xFileCB->get_active();
1158 bool bDDE = rButton.get_active();
1161 m_xFileNameFT->hide();
1162 m_xDDECommandFT->set_sensitive(
true);
1163 m_xDDECommandFT->show();
1164 m_xSubRegionFT->hide();
1165 m_xSubRegionED->hide();
1169 m_xFileNameED->set_text(OUString());
1176 m_xDDECommandFT->hide();
1177 m_xFileNameFT->set_sensitive(bFile);
1178 m_xFileNameFT->show();
1179 m_xSubRegionED->show();
1180 m_xSubRegionFT->show();
1181 m_xSubRegionED->set_sensitive(bFile);
1182 m_xSubRegionFT->set_sensitive(bFile);
1183 m_xSubRegionED->set_sensitive(bFile);
1189 m_xFileNameED->set_text(OUString());
1192 m_xFilePB->set_sensitive(bFile && !bDDE);
1204 bool bSet = bChange ? bChange :
m_xPasswdCB->get_active();
1213 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
1216 const OUString sNewPasswd(aPasswdDlg.
GetPassword());
1224 VclMessageType::Info, VclButtonsType::Ok,
1225 SwResId(STR_WRONG_PASSWD_REPEAT)));
1250 ChangePasswd(
false);
1264 std::unique_ptr<weld::TreeIter> xIter(m_xTree->make_iterator());
1265 if (m_xTree->get_selected(xIter.get()))
1267 const OUString
aName = m_xCurName->get_text();
1268 m_xTree->set_text(*xIter,
aName);
1269 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xIter));
1272 m_xOK->set_sensitive(!
aName.isEmpty());
1278 int nStartPos, nEndPos;
1279 rEdit.get_selection_bounds(nStartPos, nEndPos);
1282 rEdit.select_region(nStartPos, nEndPos);
1284 m_xTree->selected_foreach([
this, &rEdit](
weld::TreeIter& rEntry){
1285 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
1293 OUString sFileName, sFilterName, sPassword;
1296 std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium(
"sglobal"));
1300 sFilterName = pMedium->GetFilter()->GetFilterName();
1301 if (
const SfxStringItem* pItem = pMedium->GetItemSet()->GetItemIfSet( SID_PASSWORD,
false ) )
1302 sPassword = pItem->GetValue();
1307 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1310 pSectRepr->
SetFile( sFileName );
1313 m_xFileNameED->set_text(pSectRepr->
GetFile());
1319 if (m_bSubRegionsFilled)
1324 OUString sFileName = m_xFileNameED->get_text();
1325 if(!sFileName.isEmpty())
1327 SfxMedium* pMedium = m_rSh.GetView().GetDocShell()->GetMedium();
1335 SfxMedium aMedium( sFileName, StreamMode::STD_READ );
1341 m_bSubRegionsFilled =
true;
1348 uno::Reference < embed::XStorage > xStg;
1352 std::vector<OUString>
aArr;
1354 if ( nFormat == SotClipboardFormatId::STARWRITER_60 || nFormat == SotClipboardFormatId::STARWRITERGLOB_60 ||
1355 nFormat == SotClipboardFormatId::STARWRITER_8 || nFormat == SotClipboardFormatId::STARWRITERGLOB_8)
1358 for (
auto const& it :
aArr)
1367 "InsertSectionDialog",&
rSet)
1396 if (rId ==
"section")
1398 else if (rId ==
"background")
1401 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE,
static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
1404 else if (rId ==
"columns")
1411 else if (rId ==
"indents")
1423 OSL_ENSURE(
m_pSectionData,
"SwInsertSectionTabDialog: no SectionData?");
1427 uno::Reference< frame::XDispatchRecorder > xRecorder =
1429 if ( xRecorder.is() )
1435 pCol->GetColumns().size()));
1449 const OUString sLinkFileName(
m_pSectionData->GetLinkFileName() );
1460 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/sectionpage.ui",
"SectionPage", &rAttrSet)
1462 , m_xCurName(m_xBuilder->weld_entry_tree_view(
"sectionnames",
"sectionnames-entry",
1463 "sectionnames-list"))
1464 , m_xFileCB(m_xBuilder->weld_check_button(
"link"))
1465 , m_xDDECB(m_xBuilder->weld_check_button(
"dde"))
1466 , m_xDDECommandFT(m_xBuilder->weld_label(
"ddelabel"))
1467 , m_xFileNameFT(m_xBuilder->weld_label(
"filelabel"))
1468 , m_xFileNameED(m_xBuilder->weld_entry(
"filename"))
1469 , m_xFilePB(m_xBuilder->weld_button(
"selectfile"))
1470 , m_xSubRegionFT(m_xBuilder->weld_label(
"sectionlabel"))
1471 , m_xSubRegionED(m_xBuilder->weld_combo_box(
"sectionname"))
1472 , m_xProtectCB(m_xBuilder->weld_check_button(
"protect"))
1473 , m_xPasswdCB(m_xBuilder->weld_check_button(
"withpassword"))
1474 , m_xPasswdPB(m_xBuilder->weld_button(
"selectpassword"))
1475 , m_xHideCB(m_xBuilder->weld_check_button(
"hide"))
1476 , m_xConditionFT(m_xBuilder->weld_label(
"condlabel"))
1477 , m_xConditionED(new
ConditionEdit(m_xBuilder->weld_entry(
"withcond")))
1479 , m_xEditInReadonlyCB(m_xBuilder->weld_check_button(
"editable"))
1500 m_xBuilder->weld_label(
"label1")->hide();
1569 bool bDDe =
m_xDDECB->get_active();
1570 if (
m_xFileCB->get_active() && (!sFileName.isEmpty() || !sSubRegion.isEmpty() || bDDe))
1575 aLinkFile = CollapseWhiteSpaces(sFileName);
1585 if(!sFileName.isEmpty())
1601 if (!aLinkFile.isEmpty())
1619 return std::make_unique<SwInsertSectionTabPage>(pPage, pController, *rAttrSet);
1624 bool bHide = rBox.get_active();
1625 m_xConditionED->set_sensitive(bHide);
1626 m_xConditionFT->set_sensitive(bHide);
1631 bool bCheck = rBox.get_active();
1632 m_xPasswdCB->set_sensitive(bCheck);
1633 m_xPasswdPB->set_sensitive(bCheck);
1638 bool bSet = bChange ? bChange :
m_xPasswdCB->get_active();
1644 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
1647 const OUString sNewPasswd(aPasswdDlg.
GetPassword());
1655 VclMessageType::Info, VclButtonsType::Ok,
1656 SwResId(STR_WRONG_PASSWD_REPEAT)));
1670 ChangePasswd(
false);
1681 const OUString
aName = m_xCurName->get_active_text();
1682 GetDialogController()->GetOKButton().set_sensitive(!
aName.isEmpty() &&
1683 m_xCurName->find_text(
aName) == -1);
1688 if (rButton.get_active())
1690 if (m_pWrtSh->HasSelection())
1693 VclMessageType::Question, VclButtonsType::YesNo,
1695 if (
RET_NO == xQueryBox->run())
1696 rButton.set_active(
false);
1700 bool bFile = rButton.get_active();
1701 m_xFileNameFT->set_sensitive(bFile);
1702 m_xFileNameED->set_sensitive(bFile);
1703 m_xFilePB->set_sensitive(bFile);
1704 m_xSubRegionFT->set_sensitive(bFile);
1705 m_xSubRegionED->set_sensitive(bFile);
1706 m_xDDECommandFT->set_sensitive(bFile);
1707 m_xDDECB->set_sensitive(bFile);
1710 m_xFileNameED->grab_focus();
1711 m_xProtectCB->set_active(
true);
1712 ChangeProtectHdl(*m_xProtectCB);
1716 m_xDDECB->set_active(
false);
1723 m_pDocInserter.reset(new ::sfx2::DocumentInserter(
GetFrameWeld(),
"swriter"));
1729 bool bDDE = rButton.get_active();
1730 bool bFile = m_xFileCB->get_active();
1731 m_xFilePB->set_sensitive(!bDDE && bFile);
1734 m_xFileNameFT->hide();
1735 m_xDDECommandFT->set_sensitive(bDDE);
1736 m_xDDECommandFT->show();
1737 m_xSubRegionFT->hide();
1738 m_xSubRegionED->hide();
1739 m_xFileNameED->set_accessible_name(m_xDDECommandFT->get_label());
1743 m_xDDECommandFT->hide();
1744 m_xFileNameFT->set_sensitive(bFile);
1745 m_xFileNameFT->show();
1746 m_xSubRegionFT->show();
1747 m_xSubRegionED->show();
1748 m_xSubRegionED->set_sensitive(bFile);
1749 m_xFileNameED->set_accessible_name(m_xFileNameFT->get_label());
1757 std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium(
"sglobal"));
1761 m_sFilterName = pMedium->GetFilter()->GetFilterName();
1762 if (
const SfxStringItem* pItem = pMedium->GetItemSet()->GetItemIfSet( SID_PASSWORD,
false ) )
1763 m_sFilePasswd = pItem->GetValue();
1771 m_sFilterName.clear();
1772 m_sFilePasswd.clear();
1777 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/footnotesendnotestabpage.ui",
"FootnotesEndnotesTabPage", &rAttrSet)
1778 , m_xFootnoteNtAtTextEndCB(m_xBuilder->weld_check_button(
"ftnntattextend"))
1779 , m_xFootnoteNtNumCB(m_xBuilder->weld_check_button(
"ftnntnum"))
1780 , m_xFootnoteOffsetLbl(m_xBuilder->weld_label(
"ftnoffset_label"))
1781 , m_xFootnoteOffsetField(m_xBuilder->weld_spin_button(
"ftnoffset"))
1782 , m_xFootnoteNtNumFormatCB(m_xBuilder->weld_check_button(
"ftnntnumfmt"))
1783 , m_xFootnotePrefixFT(m_xBuilder->weld_label(
"ftnprefix_label"))
1784 , m_xFootnotePrefixED(m_xBuilder->weld_entry(
"ftnprefix"))
1786 , m_xFootnoteSuffixFT(m_xBuilder->weld_label(
"ftnsuffix_label"))
1787 , m_xFootnoteSuffixED(m_xBuilder->weld_entry(
"ftnsuffix"))
1788 , m_xEndNtAtTextEndCB(m_xBuilder->weld_check_button(
"endntattextend"))
1789 , m_xEndNtNumCB(m_xBuilder->weld_check_button(
"endntnum"))
1790 , m_xEndOffsetLbl(m_xBuilder->weld_label(
"endoffset_label"))
1791 , m_xEndOffsetField(m_xBuilder->weld_spin_button(
"endoffset"))
1792 , m_xEndNtNumFormatCB(m_xBuilder->weld_check_button(
"endntnumfmt"))
1793 , m_xEndPrefixFT(m_xBuilder->weld_label(
"endprefix_label"))
1794 , m_xEndPrefixED(m_xBuilder->weld_entry(
"endprefix"))
1796 , m_xEndSuffixFT(m_xBuilder->weld_label(
"endsuffix_label"))
1797 , m_xEndSuffixED(m_xBuilder->weld_entry(
"endsuffix"))
1904 const sal_uInt16 eState = rAttr.
GetValue();
1956 return std::make_unique<SwSectionFootnoteEndTabPage>(pPage, pController, *rAttrSet);
1961 bool bFoot = m_xFootnoteNtAtTextEndCB.get() == &rBox || m_xFootnoteNtNumCB.get() == &rBox ||
1962 m_xFootnoteNtNumFormatCB.get() == &rBox ;
1973 pEndBox = m_xFootnoteNtAtTextEndCB.get();
1974 pNumBox = m_xFootnoteNtNumCB.get();
1975 pNumFormatBox = m_xFootnoteNtNumFormatCB.get();
1976 pNumViewBox = m_xFootnoteNumViewBox.get();
1977 pOffsetText = m_xFootnoteOffsetLbl.get();
1978 pOffsetField = m_xFootnoteOffsetField.get();
1979 pPrefixFT = m_xFootnotePrefixFT.get();
1980 pSuffixFT = m_xFootnoteSuffixFT.get();
1981 pPrefixED = m_xFootnotePrefixED.get();
1982 pSuffixED = m_xFootnoteSuffixED.get();
1986 pEndBox = m_xEndNtAtTextEndCB.get();
1987 pNumBox = m_xEndNtNumCB.get();
1988 pNumFormatBox = m_xEndNtNumFormatCB.get();
1989 pNumViewBox = m_xEndNumViewBox.get();
1990 pOffsetText = m_xEndOffsetLbl.get();
1991 pOffsetField = m_xEndOffsetField.get();
1992 pPrefixFT = m_xEndPrefixFT.get();
1993 pSuffixFT = m_xEndSuffixFT.get();
1994 pPrefixED = m_xEndPrefixED.get();
1995 pSuffixED = m_xEndSuffixED.get();
2016 "FormatSectionDialog", &
rSet)
2042 if (rId ==
"background")
2045 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE,
static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
2048 else if (rId ==
"columns")
2053 else if (rId ==
"indents")
2058 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/indentpage.ui",
"IndentPage", &rAttrSet)
2059 , m_xBeforeMF(m_xBuilder->weld_metric_spin_button(
"before",
FieldUnit::
CM))
2060 , m_xAfterMF(m_xBuilder->weld_metric_spin_button(
"after",
FieldUnit::
CM))
2061 , m_xPreviewWin(new
weld::CustomWeld(*m_xBuilder,
"preview", m_aPreviewWin))
2092 if ( eItemState >= SfxItemState::DEFAULT )
2112 return std::make_unique<SwSectionIndentTabPage>(pPage, pController, *rAttrSet);
2127 m_aPreviewWin.SetLeftMargin(m_xBeforeMF->denormalize(m_xBeforeMF->get_value(FieldUnit::TWIP)));
2128 m_aPreviewWin.SetRightMargin(m_xAfterMF->denormalize(m_xAfterMF->get_value(FieldUnit::TWIP)));
2129 m_aPreviewWin.Invalidate();
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
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 getBookmarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of IBookmarks.
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
virtual size_t GetSectionList(SfxMedium &rMedium, std::vector< OUString > &rStrings) const
std::unique_ptr< SvxBrushItem > m_Brush
SwSectionData & GetSectionData()
SwFormatFootnoteAtTextEnd & GetFootnoteNtAtEnd()
SwFormatNoBalancedColumns & GetBalance()
void SetTempPasswd(const uno::Sequence< sal_Int8 > &rPasswd)
void SetFilter(std::u16string_view rFilter)
SwFormatNoBalancedColumns m_Balance
SwFormatFootnoteAtTextEnd m_FootnoteNtAtEnd
uno::Sequence< sal_Int8 > & GetTempPasswd()
OUString GetSubRegion() const
SwFormatEndAtTextEnd & GetEndNtAtEnd()
std::shared_ptr< SvxFrameDirectionItem > m_FrameDirItem
SwFormatEndAtTextEnd m_EndNtAtEnd
void SetContent(bool const bValue)
std::shared_ptr< SvxLRSpaceItem > & GetLRSpace()
SectRepr(size_t nPos, SwSection &rSect)
std::shared_ptr< SvxLRSpaceItem > m_LRSpaceItem
SwSectionData m_SectionData
std::shared_ptr< SvxFrameDirectionItem > & GetFrameDir()
uno::Sequence< sal_Int8 > m_TempPasswd
void SetFile(std::u16string_view rFile)
std::unique_ptr< SvxBrushItem > & GetBackground()
void SetSubRegion(std::u16string_view rSubRegion)
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
void SetValue(bool const bTheValue)
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
const INetURLObject & GetURLObject() const
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
SfxMedium * GetMedium() const
OUString GetPassword() const
virtual short run() override
OUString GetConfirm() const
void ShowExtras(SfxShowExtras nExtras)
void AppendItem(const SfxPoolItem &)
void Done(bool bRemove=false)
void SetCurPageId(const OString &rName)
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
virtual short run() override
const SfxItemSet * GetOutputItemSet() const
void RemoveTabPage(const OString &rName)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
SfxOkDialogController * GetDialogController() const
weld::Window * GetFrameWeld() const
SfxBindings & GetBindings()
SfxViewFrame & GetViewFrame() const
static SotClipboardFormatId GetFormatID(css::uno::Reference< css::embed::XStorage > const &xStorage)
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 SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual SvxFrameDirectionItem * Clone(SfxItemPool *pPool=nullptr) const override
tools::Long GetRight() const
virtual SvxLRSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
tools::Long GetLeft() const
void SetAdjust(SvxAdjust eNew)
void SetLastLine(SvxAdjust eNew)
tools::Long GetWidth() const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::ComboBox > m_xSubRegionED
virtual ~SwEditRegionDlg() override
std::unique_ptr< weld::CheckButton > m_xFileCB
SwEditRegionDlg(weld::Window *pParent, SwWrtShell &rWrtSh)
std::unique_ptr< weld::Button > m_xPasswdPB
std::unique_ptr< weld::Entry > m_xFileNameED
void RecurseList(const SwSectionFormat *pFormat, const weld::TreeIter *pIter)
size_t FindArrPos(const SwSectionFormat *pFormat)
const SwSection * m_pCurrSect
std::unique_ptr< weld::CheckButton > m_xDDECB
std::unique_ptr< weld::Button > m_xDismiss
std::unique_ptr< weld::Entry > m_xCurName
std::unique_ptr< ConditionEdit > m_xConditionED
std::unique_ptr< weld::CheckButton > m_xProtectCB
std::unique_ptr< weld::Button > m_xOK
std::unique_ptr< weld::CheckButton > m_xPasswdCB
std::unique_ptr< weld::Button > m_xFilePB
bool CheckPasswd(weld::Toggleable *pBox=nullptr)
std::unique_ptr< weld::Button > m_xOptionsPB
void ChangePasswd(bool bChange)
std::unique_ptr< weld::TreeView > m_xTree
std::unique_ptr< weld::Widget > m_xHideFrame
void SelectSection(std::u16string_view rSectionName)
std::unique_ptr< weld::CheckButton > m_xHideCB
std::unique_ptr< weld::CheckButton > m_xEditInReadonlyCB
size_t GetSectionFormatCount() const
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
const SwSection * GetCurrSection() const
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
const SwSectionFormat & GetSectionFormat(size_t nFormat) const
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
virtual short Ok() override
void SetSectionData(SwSectionData const &rSect)
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
SwInsertSectionTabDialog(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell &rSh)
virtual ~SwInsertSectionTabDialog() override
std::unique_ptr< SwSectionData > m_pSectionData
std::unique_ptr< weld::Label > m_xSubRegionFT
std::unique_ptr< weld::Button > m_xPasswdPB
std::unique_ptr< weld::Label > m_xFileNameFT
std::unique_ptr< weld::CheckButton > m_xPasswdCB
std::unique_ptr< weld::CheckButton > m_xDDECB
void SetWrtShell(SwWrtShell &rSh)
std::unique_ptr< weld::Entry > m_xFileNameED
std::unique_ptr< weld::CheckButton > m_xFileCB
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual ~SwInsertSectionTabPage() override
void ChangePasswd(bool bChange)
std::unique_ptr< weld::CheckButton > m_xProtectCB
std::unique_ptr< weld::CheckButton > m_xEditInReadonlyCB
std::unique_ptr< weld::Label > m_xDDECommandFT
css::uno::Sequence< sal_Int8 > m_aNewPasswd
std::unique_ptr< weld::EntryTreeView > m_xCurName
std::unique_ptr< ConditionEdit > m_xConditionED
SwInsertSectionTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::Label > m_xConditionFT
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xHideCB
std::unique_ptr< weld::ComboBox > m_xSubRegionED
std::unique_ptr< weld::Button > m_xFilePB
void set_sensitive(bool bEnable)
bool SelectNumberingType(SvxNumType nType)
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
void Width(tools::Long nNew)
bool IsEditInReadonlyFlag() const
void SetHidden(bool const bFlag)
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
void SetEditInReadonlyFlag(bool const bFlag)
const OUString & GetLinkFilePassword() const
void SetSectionName(OUString const &rName)
bool IsProtectFlag() const
void SetType(SectionType const eNew)
SectionType GetType() const
void SetLinkFilePassword(OUString const &rS)
void SetCondition(OUString const &rNew)
void SetLinkFileName(OUString const &rNew)
const OUString & GetCondition() const
const OUString & GetLinkFileName() const
css::uno::Sequence< sal_Int8 > const & GetPassword() const
void SetPassword(css::uno::Sequence< sal_Int8 > const &rNew)
const OUString & GetSectionName() const
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::MetricSpinButton > m_xAfterMF
std::unique_ptr< weld::MetricSpinButton > m_xBeforeMF
virtual ~SwSectionIndentTabPage() override
virtual void Reset(const SfxItemSet *) override
void SetWrtShell(SwWrtShell const &rSh)
SvxParaPrevWindow m_aPreviewWin
SwSectionIndentTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
virtual ~SwSectionPropertyTabDialog() override
SwSectionPropertyTabDialog(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell &rSh)
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
const OUString & GetSectionName() const
SwSectionFormat * GetFormat()
SectionType GetType() const
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
const SwView & GetView() const
void append_text(const OUString &rStr)
virtual void set_text(const OUString &rText)=0
virtual bool get_active() const=0
virtual void set_active(bool active)=0
TriState get_state() const
void set_state(TriState eState)
#define FN_PARAM_REGION_PROTECT
#define FN_PARAM_REGION_NAME
#define FN_PARAM_REGION_CONDITION
#define FN_PARAM_REGION_EDIT_IN_READONLY
#define FN_PARAM_REGION_HIDDEN
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
@ Page
Rect of current page.
Reader * SwGetReaderXML()
@ Variable
Frame is variable in Var-direction.
@ FTNEND_ATTXTEND
at end of the current text end
@ FTNEND_ATTXTEND_OWNNUMANDFMT
-""- and with own numberformat
@ FTNEND_ATTXTEND_OWNNUMSEQ
-""- and with own number sequence
@ FTNEND_ATPGORDOCEND
at page or document end
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(124)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(123)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SwFormatNoBalancedColumns > RES_COLUMNBALANCE(125)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
#define LINK(Instance, Class, Member)
sal_uInt16 GetExportMode()
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)
std::shared_ptr< T > make_shared(Args &&... args)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
const sal_Unicode cTokenSeparator
OUString toId(const void *pValue)
std::vector< SwSection * > SwSections
OUString SwResId(TranslateId aId)
IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, weld::TreeView &, rBox, void)
static void lcl_FillSubRegionList(SwWrtShell &rSh, weld::ComboBox &rSubRegions, weld::ComboBox *pAvailNames)
static void lcl_ReadSections(SfxMedium &rMedium, weld::ComboBox &rBox)
IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl, weld::Button &, void)
static void lcl_FillList(SwWrtShell &rSh, weld::ComboBox &rSubRegions, weld::ComboBox *pAvailNames, const SwSectionFormat *pNewFormat)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)