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))
442 if (aPasswdDlg.
run())
444 const OUString sNewPasswd(aPasswdDlg.
GetPassword());
445 css::uno::Sequence <sal_Int8 > aNewPasswd;
456 VclMessageType::Info, VclButtonsType::Ok,
477 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
495 m_xTree->insert(
nullptr, -1, &sText, &
sId,
nullptr,
nullptr,
false, xIter.get());
496 m_xTree->set_image(*xIter, sImage);
499 if (
m_xTree->iter_has_child(*xIter))
504 m_xTree->scroll_to_row(*xIter);
514 for(
const auto pSect : aTmpArr )
517 pFormat = pSect->GetFormat();
525 OUString sText(pSect->GetSectionName());
526 OUString sImage = BuildBitmap(pSect->IsProtect(), pSect->IsHidden());
528 m_xTree->insert(pEntry, -1, &sText, &
sId,
nullptr,
nullptr,
false, xIter.get());
529 m_xTree->set_image(*xIter, sImage);
532 if (
m_xTree->iter_has_child(*xIter))
537 m_xTree->scroll_to_row(*xIter);
552 OSL_FAIL(
"SectionFormat not on the list" );
558 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
559 if (
m_xTree->get_iter_first(*xIter))
563 delete weld::fromId<SectRepr*>(
m_xTree->get_id(*xIter));
564 }
while (
m_xTree->iter_next(*xIter));
570 std::unique_ptr<weld::TreeIter> xIter(
m_xTree->make_iterator());
571 if (!
m_xTree->get_iter_first(*xIter))
581 m_xTree->scroll_to_row(*xIter);
585 }
while (
m_xTree->iter_next(*xIter));
592 m_bDontCheckPasswd =
true;
593 std::unique_ptr<weld::TreeIter> xIter(rBox.make_iterator());
594 bool bEntry = rBox.get_selected(xIter.get());
595 m_xHideCB->set_sensitive(
true);
597 m_xEditInReadonlyCB->set_sensitive(
true);
599 m_xProtectCB->set_sensitive(
true);
600 m_xFileCB->set_sensitive(
true);
601 css::uno::Sequence <sal_Int8> aCurPasswd;
602 if (1 < rBox.count_selected_rows())
610 bool bHiddenValid =
true;
611 bool bProtectValid =
true;
612 bool bConditionValid =
true;
614 bool bEditInReadonlyValid =
true;
615 bool bEditInReadonly =
true;
618 bool bProtect =
true;
621 bool bFileValid =
true;
623 bool bPasswdValid =
true;
626 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
642 bConditionValid =
false;
643 bHiddenValid = (bHidden == rData.
IsHidden());
646 bEditInReadonlyValid =
649 bFileValid = (bFile ==
651 bPasswdValid = (aCurPasswd == rData.
GetPassword());
662 m_xEditInReadonlyCB->set_state(!bEditInReadonlyValid ?
TRISTATE_INDET :
669 m_xConditionED->set_text(sCondition);
672 m_xConditionFT->set_sensitive(
false);
673 m_xConditionED->set_sensitive(
false);
676 m_xCurName->set_sensitive(
false);
677 m_xDDECB->set_sensitive(
false);
678 m_xDDEFrame->set_sensitive(
false);
679 m_xOptionsPB->set_sensitive(
false);
680 bool bPasswdEnabled = m_xProtectCB->get_state() ==
TRISTATE_TRUE;
681 m_xPasswdCB->set_sensitive(bPasswdEnabled);
682 m_xPasswdPB->set_sensitive(bPasswdEnabled);
685 rBox.get_selected(xIter.get());
688 GetFirstEntryHdl(rBox);
692 m_xPasswdCB->set_active(aCurPasswd.hasElements());
696 m_xCurName->set_sensitive(
true);
697 m_xOptionsPB->set_sensitive(
true);
698 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xIter));
701 m_xHideCB->set_sensitive(
true);
704 m_xConditionED->set_sensitive(bHide);
705 m_xConditionFT->set_sensitive(bHide);
706 m_xPasswdCB->set_active(rData.
GetPassword().hasElements());
708 m_xOK->set_sensitive(
true);
709 m_xPasswdCB->set_sensitive(
true);
710 m_xCurName->set_text(rBox.get_text(*xIter));
711 m_xCurName->set_sensitive(
true);
712 m_xDismiss->set_sensitive(
true);
713 const OUString aFile = pRepr->
GetFile();
715 m_xSubRegionED->clear();
716 m_xSubRegionED->append_text(
"");
717 m_bSubRegionsFilled =
false;
718 if( !aFile.isEmpty() || !sSub.isEmpty() )
720 m_xFileCB->set_active(
true);
721 m_xFileNameED->set_text(aFile);
722 m_xSubRegionED->set_entry_text(sSub);
727 m_xFileCB->set_active(
false);
728 m_xFileNameED->set_text(aFile);
729 m_xDDECB->set_sensitive(
false);
730 m_xDDECB->set_active(
false);
732 UseFileHdl(*m_xFileCB);
736 m_xProtectCB->set_sensitive(
true);
741 m_xEditInReadonlyCB->set_sensitive(
true);
743 bool bPasswdEnabled = m_xProtectCB->get_active();
744 m_xPasswdCB->set_sensitive(bPasswdEnabled);
745 m_xPasswdPB->set_sensitive(bPasswdEnabled);
747 m_bDontCheckPasswd =
false;
763 m_rSh.StartAllAction();
765 m_rSh.ResetSelect(
nullptr,
false );
767 std::unique_ptr<weld::TreeIter> xIter(m_xTree->make_iterator());
768 if (m_xTree->get_iter_first(*xIter))
772 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xIter));
778 size_t nNewPos = rDocFormats.
GetPos(pFormat);
779 if ( SIZE_MAX != nNewPos )
781 std::unique_ptr<SfxItemSet> pSet(pFormat->
GetAttrSet().
Clone(
false ));
783 pSet->Put( pRepr->
GetCol() );
805 pSet->Count() ? pSet.get() :
nullptr );
807 }
while (m_xTree->iter_next(*xIter));
810 for (SectReprs_t::reverse_iterator it = m_SectReprs.rbegin(), aEnd = m_SectReprs.rend(); it != aEnd; ++it)
812 assert(it->first == it->second->GetArrPos());
814 const size_t nNewPos = rDocFormats.
GetPos( pFormat );
815 if( SIZE_MAX != nNewPos )
816 m_rSh.DelSectionFormat( nNewPos );
826 m_rSh.EndAllAction();
832 if (!CheckPasswd(&rButton))
836 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
838 OUString aImage = BuildBitmap(bCheck,
TRISTATE_TRUE == m_xHideCB->get_state());
839 m_xTree->set_image(rEntry, aImage);
842 m_xPasswdCB->set_sensitive(bCheck);
843 m_xPasswdPB->set_sensitive(bCheck);
849 if (!CheckPasswd(&rButton))
851 m_xTree->selected_foreach([
this, &rButton](
weld::TreeIter& rEntry){
852 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
854 OUString aImage = BuildBitmap(
TRISTATE_TRUE == m_xProtectCB->get_state(),
856 m_xTree->set_image(rEntry, aImage);
860 m_xConditionED->set_sensitive(bHide);
861 m_xConditionFT->set_sensitive(bHide);
867 if (!CheckPasswd(&rButton))
869 m_xTree->selected_foreach([
this, &rButton](
weld::TreeIter& rEntry){
870 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
884 SectRepr*
const pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
889 std::unique_ptr<weld::TreeIter> xEntry(m_xTree->make_iterator());
890 bool bEntry(m_xTree->get_selected(xEntry.get()));
894 SectRepr*
const pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xEntry));
895 std::unique_ptr<weld::TreeIter> xRemove;
896 bool bRestart =
false;
899 m_SectReprs.insert(std::make_pair(pSectRepr->
GetArrPos(),
900 std::unique_ptr<SectRepr>(pSectRepr)));
901 if (m_xTree->iter_has_child(*xEntry))
903 std::unique_ptr<weld::TreeIter> xChild(m_xTree->make_iterator(xEntry.get()));
904 (void)m_xTree->iter_children(*xChild);
905 std::unique_ptr<weld::TreeIter> xParent(m_xTree->make_iterator(xEntry.get()));
906 if (!m_xTree->iter_parent(*xParent))
913 std::unique_ptr<weld::TreeIter> xMove(m_xTree->make_iterator(xChild.get()));
914 bChild = m_xTree->iter_next_sibling(*xChild);
915 m_xTree->move_subtree(*xMove, xParent.get(), m_xTree->get_iter_index_in_parent(*xEntry));
918 xRemove = m_xTree->make_iterator(xEntry.get());
921 bEntry = m_xTree->get_iter_first(*xEntry);
923 bEntry = m_xTree->iter_next(*xEntry);
925 m_xTree->remove(*xRemove);
928 if (m_xTree->get_selected(
nullptr))
931 m_xConditionFT->set_sensitive(
false);
932 m_xConditionED->set_sensitive(
false);
933 m_xDismiss->set_sensitive(
false);
934 m_xCurName->set_sensitive(
false);
935 m_xProtectCB->set_sensitive(
false);
936 m_xPasswdCB->set_sensitive(
false);
937 m_xHideCB->set_sensitive(
false);
939 m_xEditInReadonlyCB->set_sensitive(
false);
942 m_xPasswdCB->set_active(
false);
944 m_xFileCB->set_active(
false);
947 UseFileHdl(*m_xFileCB);
953 if (!CheckPasswd(&rButton))
955 bool bMulti = 1 < m_xTree->count_selected_rows();
956 bool bFile = rButton.get_active();
957 if (m_xTree->get_selected(
nullptr))
960 SectRepr*
const pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
962 if( rButton.get_active() && bContent && m_rSh.HasSelection() )
965 VclMessageType::Question, VclButtonsType::YesNo,
967 if (
RET_NO == xQueryBox->run())
968 rButton.set_active(
false );
980 m_xDDECB->set_sensitive(bFile && !bMulti);
981 m_xDDEFrame->set_sensitive(bFile && !bMulti);
985 m_xFileNameED->grab_focus();
990 m_xDDECB->set_active(
false);
991 m_xSubRegionED->set_entry_text(OUString());
997 rButton.set_active(
false);
998 rButton.set_sensitive(
false);
999 m_xDDECB->set_active(
false);
1000 m_xDDECB->set_sensitive(
false);
1001 m_xDDEFrame->set_sensitive(
false);
1010 m_pDocInserter.reset(new ::sfx2::DocumentInserter(
m_xDialog.get(),
"swriter"));
1018 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1029 SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE> aSet( m_rSh.GetView().GetPool() );
1031 aSet.Put( pSectRepr->
GetCol() );
1043 tools::Long nWidth = m_rSh.GetSectionWidth(*pFormat);
1056 if( !(pOutSet && pOutSet->
Count()) )
1085 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
1087 pRepr->
GetCol() = *pColItem;
1097 pRepr->
GetFrameDir()->SetValue(pFrameDirItem->GetValue());
1106 int nStartPos, nEndPos;
1107 rEdit.get_entry_selection_bounds(nStartPos, nEndPos);
1110 rEdit.select_entry_region(nStartPos, nEndPos);
1111 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1118 int nStartPos, nEndPos;
1119 rEdit.get_selection_bounds(nStartPos, nEndPos);
1122 rEdit.select_region(nStartPos, nEndPos);
1123 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1124 m_xSubRegionED->clear();
1125 m_xSubRegionED->append_text(
"");
1126 m_bSubRegionsFilled =
false;
1127 if (m_xDDECB->get_active())
1129 OUString sLink( CollapseWhiteSpaces(rEdit.get_text()) );
1142 OUString sTmp(rEdit.get_text());
1145 SfxMedium* pMedium = m_rSh.GetView().GetDocShell()->GetMedium();
1159 if (!CheckPasswd(&rButton))
1161 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1165 bool bFile = m_xFileCB->get_active();
1167 bool bDDE = rButton.get_active();
1170 m_xFileNameFT->hide();
1171 m_xDDECommandFT->set_sensitive(
true);
1172 m_xDDECommandFT->show();
1173 m_xSubRegionFT->hide();
1174 m_xSubRegionED->hide();
1178 m_xFileNameED->set_text(OUString());
1185 m_xDDECommandFT->hide();
1186 m_xFileNameFT->set_sensitive(bFile);
1188 m_xFileNameFT->show();
1189 m_xSubRegionED->show();
1190 m_xSubRegionFT->show();
1191 m_xSubRegionED->set_sensitive(bFile);
1192 m_xSubRegionFT->set_sensitive(bFile);
1193 m_xSubRegionED->set_sensitive(bFile);
1199 m_xFileNameED->set_text(OUString());
1202 m_xFilePB->set_sensitive(bFile && !bDDE);
1214 bool bSet = bChange ? bChange :
m_xPasswdCB->get_active();
1223 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
1226 const OUString sNewPasswd(aPasswdDlg.
GetPassword());
1234 VclMessageType::Info, VclButtonsType::Ok,
1235 SwResId(STR_WRONG_PASSWD_REPEAT)));
1260 ChangePasswd(
false);
1274 std::unique_ptr<weld::TreeIter> xIter(m_xTree->make_iterator());
1275 if (m_xTree->get_selected(xIter.get()))
1277 const OUString
aName = m_xCurName->get_text();
1278 m_xTree->set_text(*xIter,
aName);
1279 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(*xIter));
1282 m_xOK->set_sensitive(!
aName.isEmpty());
1288 int nStartPos, nEndPos;
1289 rEdit.get_selection_bounds(nStartPos, nEndPos);
1292 rEdit.select_region(nStartPos, nEndPos);
1294 m_xTree->selected_foreach([
this, &rEdit](
weld::TreeIter& rEntry){
1295 SectRepr* pRepr = weld::fromId<SectRepr*>(m_xTree->get_id(rEntry));
1303 OUString sFileName, sFilterName, sPassword;
1306 std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium(
"sglobal"));
1310 sFilterName = pMedium->GetFilter()->GetFilterName();
1311 if (
const SfxStringItem* pItem = pMedium->GetItemSet().GetItemIfSet( SID_PASSWORD,
false ) )
1312 sPassword = pItem->GetValue();
1317 SectRepr* pSectRepr = weld::fromId<SectRepr*>(m_xTree->get_selected_id());
1320 pSectRepr->
SetFile( sFileName );
1323 m_xFileNameED->set_text(pSectRepr->
GetFile());
1329 if (m_bSubRegionsFilled)
1334 OUString sFileName = m_xFileNameED->get_text();
1335 if(!sFileName.isEmpty())
1337 SfxMedium* pMedium = m_rSh.GetView().GetDocShell()->GetMedium();
1345 SfxMedium aMedium( sFileName, StreamMode::STD_READ );
1351 m_bSubRegionsFilled =
true;
1358 uno::Reference < embed::XStorage > xStg;
1362 std::vector<OUString>
aArr;
1364 if ( nFormat == SotClipboardFormatId::STARWRITER_60 || nFormat == SotClipboardFormatId::STARWRITERGLOB_60 ||
1365 nFormat == SotClipboardFormatId::STARWRITER_8 || nFormat == SotClipboardFormatId::STARWRITERGLOB_8)
1368 for (
auto const& it :
aArr)
1377 "InsertSectionDialog",&
rSet)
1406 if (rId ==
"section")
1408 else if (rId ==
"background")
1411 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE,
static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
1414 else if (rId ==
"columns")
1421 else if (rId ==
"indents")
1433 OSL_ENSURE(
m_pSectionData,
"SwInsertSectionTabDialog: no SectionData?");
1437 uno::Reference< frame::XDispatchRecorder > xRecorder =
1439 if ( xRecorder.is() )
1445 pCol->GetColumns().size()));
1459 const OUString sLinkFileName(
m_pSectionData->GetLinkFileName() );
1470 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/sectionpage.ui",
"SectionPage", &rAttrSet)
1472 , m_xCurName(m_xBuilder->weld_entry_tree_view(
"sectionnames",
"sectionnames-entry",
1473 "sectionnames-list"))
1474 , m_xFileCB(m_xBuilder->weld_check_button(
"link"))
1475 , m_xDDECB(m_xBuilder->weld_check_button(
"dde"))
1476 , m_xDDECommandFT(m_xBuilder->weld_label(
"ddelabel"))
1477 , m_xFileNameFT(m_xBuilder->weld_label(
"filelabel"))
1478 , m_xFileNameED(m_xBuilder->weld_entry(
"filename"))
1479 , m_xFilePB(m_xBuilder->weld_button(
"selectfile"))
1480 , m_xSubRegionFT(m_xBuilder->weld_label(
"sectionlabel"))
1481 , m_xSubRegionED(m_xBuilder->weld_combo_box(
"sectionname"))
1482 , m_xProtectCB(m_xBuilder->weld_check_button(
"protect"))
1483 , m_xPasswdCB(m_xBuilder->weld_check_button(
"withpassword"))
1484 , m_xPasswdPB(m_xBuilder->weld_button(
"selectpassword"))
1485 , m_xHideCB(m_xBuilder->weld_check_button(
"hide"))
1486 , m_xConditionFT(m_xBuilder->weld_label(
"condlabel"))
1487 , m_xConditionED(new
ConditionEdit(m_xBuilder->weld_entry(
"withcond")))
1489 , m_xEditInReadonlyCB(m_xBuilder->weld_check_button(
"editable"))
1510 m_xBuilder->weld_label(
"label1")->hide();
1579 bool bDDe =
m_xDDECB->get_active();
1580 if (
m_xFileCB->get_active() && (!sFileName.isEmpty() || !sSubRegion.isEmpty() || bDDe))
1585 aLinkFile = CollapseWhiteSpaces(sFileName);
1595 if(!sFileName.isEmpty())
1611 if (!aLinkFile.isEmpty())
1629 return std::make_unique<SwInsertSectionTabPage>(pPage, pController, *rAttrSet);
1634 bool bHide = rBox.get_active();
1635 m_xConditionED->set_sensitive(bHide);
1636 m_xConditionFT->set_sensitive(bHide);
1641 bool bCheck = rBox.get_active();
1642 m_xPasswdCB->set_sensitive(bCheck);
1643 m_xPasswdPB->set_sensitive(bCheck);
1648 bool bSet = bChange ? bChange :
m_xPasswdCB->get_active();
1654 aPasswdDlg.
ShowExtras(SfxShowExtras::CONFIRM);
1657 const OUString sNewPasswd(aPasswdDlg.
GetPassword());
1665 VclMessageType::Info, VclButtonsType::Ok,
1666 SwResId(STR_WRONG_PASSWD_REPEAT)));
1680 ChangePasswd(
false);
1691 const OUString
aName = m_xCurName->get_active_text();
1692 GetDialogController()->GetOKButton().set_sensitive(!
aName.isEmpty() &&
1693 m_xCurName->find_text(
aName) == -1);
1698 if (rButton.get_active())
1700 if (m_pWrtSh->HasSelection())
1703 VclMessageType::Question, VclButtonsType::YesNo,
1705 if (
RET_NO == xQueryBox->run())
1706 rButton.set_active(
false);
1710 bool bFile = rButton.get_active();
1711 m_xFileNameFT->set_sensitive(bFile);
1712 m_xFileNameED->set_sensitive(bFile);
1713 m_xFilePB->set_sensitive(bFile);
1714 m_xSubRegionFT->set_sensitive(bFile);
1715 m_xSubRegionED->set_sensitive(bFile);
1716 m_xDDECommandFT->set_sensitive(bFile);
1717 m_xDDECB->set_sensitive(bFile);
1720 m_xFileNameED->grab_focus();
1721 m_xProtectCB->set_active(
true);
1722 ChangeProtectHdl(*m_xProtectCB);
1726 m_xDDECB->set_active(
false);
1733 m_pDocInserter.reset(new ::sfx2::DocumentInserter(
GetFrameWeld(),
"swriter"));
1739 bool bDDE = rButton.get_active();
1740 bool bFile = m_xFileCB->get_active();
1741 m_xFilePB->set_sensitive(!bDDE && bFile);
1744 m_xFileNameFT->hide();
1745 m_xDDECommandFT->set_sensitive(bDDE);
1746 m_xDDECommandFT->show();
1747 m_xSubRegionFT->hide();
1748 m_xSubRegionED->hide();
1749 m_xFileNameED->set_accessible_name(m_xDDECommandFT->get_label());
1753 m_xDDECommandFT->hide();
1754 m_xFileNameFT->set_sensitive(bFile);
1756 m_xFileNameFT->show();
1757 m_xSubRegionFT->show();
1758 m_xSubRegionED->show();
1759 m_xSubRegionED->set_sensitive(bFile);
1760 m_xFileNameED->set_accessible_name(m_xFileNameFT->get_label());
1768 std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium(
"sglobal"));
1772 m_sFilterName = pMedium->GetFilter()->GetFilterName();
1773 if (
const SfxStringItem* pItem = pMedium->GetItemSet().GetItemIfSet( SID_PASSWORD,
false ) )
1774 m_sFilePasswd = pItem->GetValue();
1782 m_sFilterName.clear();
1783 m_sFilePasswd.clear();
1788 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/footnotesendnotestabpage.ui",
"FootnotesEndnotesTabPage", &rAttrSet)
1789 , m_xFootnoteNtAtTextEndCB(m_xBuilder->weld_check_button(
"ftnntattextend"))
1790 , m_xFootnoteNtNumCB(m_xBuilder->weld_check_button(
"ftnntnum"))
1791 , m_xFootnoteOffsetLbl(m_xBuilder->weld_label(
"ftnoffset_label"))
1792 , m_xFootnoteOffsetField(m_xBuilder->weld_spin_button(
"ftnoffset"))
1793 , m_xFootnoteNtNumFormatCB(m_xBuilder->weld_check_button(
"ftnntnumfmt"))
1794 , m_xFootnotePrefixFT(m_xBuilder->weld_label(
"ftnprefix_label"))
1795 , m_xFootnotePrefixED(m_xBuilder->weld_entry(
"ftnprefix"))
1797 , m_xFootnoteSuffixFT(m_xBuilder->weld_label(
"ftnsuffix_label"))
1798 , m_xFootnoteSuffixED(m_xBuilder->weld_entry(
"ftnsuffix"))
1799 , m_xEndNtAtTextEndCB(m_xBuilder->weld_check_button(
"endntattextend"))
1800 , m_xEndNtNumCB(m_xBuilder->weld_check_button(
"endntnum"))
1801 , m_xEndOffsetLbl(m_xBuilder->weld_label(
"endoffset_label"))
1802 , m_xEndOffsetField(m_xBuilder->weld_spin_button(
"endoffset"))
1803 , m_xEndNtNumFormatCB(m_xBuilder->weld_check_button(
"endntnumfmt"))
1804 , m_xEndPrefixFT(m_xBuilder->weld_label(
"endprefix_label"))
1805 , m_xEndPrefixED(m_xBuilder->weld_entry(
"endprefix"))
1807 , m_xEndSuffixFT(m_xBuilder->weld_label(
"endsuffix_label"))
1808 , m_xEndSuffixED(m_xBuilder->weld_entry(
"endsuffix"))
1915 const sal_uInt16 eState = rAttr.
GetValue();
1967 return std::make_unique<SwSectionFootnoteEndTabPage>(pPage, pController, *rAttrSet);
1972 bool bFoot = m_xFootnoteNtAtTextEndCB.get() == &rBox || m_xFootnoteNtNumCB.get() == &rBox ||
1973 m_xFootnoteNtNumFormatCB.get() == &rBox ;
1984 pEndBox = m_xFootnoteNtAtTextEndCB.get();
1985 pNumBox = m_xFootnoteNtNumCB.get();
1986 pNumFormatBox = m_xFootnoteNtNumFormatCB.get();
1987 pNumViewBox = m_xFootnoteNumViewBox.get();
1988 pOffsetText = m_xFootnoteOffsetLbl.get();
1989 pOffsetField = m_xFootnoteOffsetField.get();
1990 pPrefixFT = m_xFootnotePrefixFT.get();
1991 pSuffixFT = m_xFootnoteSuffixFT.get();
1992 pPrefixED = m_xFootnotePrefixED.get();
1993 pSuffixED = m_xFootnoteSuffixED.get();
1997 pEndBox = m_xEndNtAtTextEndCB.get();
1998 pNumBox = m_xEndNtNumCB.get();
1999 pNumFormatBox = m_xEndNtNumFormatCB.get();
2000 pNumViewBox = m_xEndNumViewBox.get();
2001 pOffsetText = m_xEndOffsetLbl.get();
2002 pOffsetField = m_xEndOffsetField.get();
2003 pPrefixFT = m_xEndPrefixFT.get();
2004 pSuffixFT = m_xEndSuffixFT.get();
2005 pPrefixED = m_xEndPrefixED.get();
2006 pSuffixED = m_xEndSuffixED.get();
2027 "FormatSectionDialog", &
rSet)
2053 if (rId ==
"background")
2056 aSet.
Put (
SfxUInt32Item(SID_FLAG_TYPE,
static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
2059 else if (rId ==
"columns")
2064 else if (rId ==
"indents")
2069 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/indentpage.ui",
"IndentPage", &rAttrSet)
2070 , m_xBeforeMF(m_xBuilder->weld_metric_spin_button(
"before",
FieldUnit::
CM))
2071 , m_xAfterMF(m_xBuilder->weld_metric_spin_button(
"after",
FieldUnit::
CM))
2072 , m_xPreviewWin(new
weld::CustomWeld(*m_xBuilder,
"preview", m_aPreviewWin))
2103 if ( eItemState >= SfxItemState::DEFAULT )
2123 return std::make_unique<SwSectionIndentTabPage>(pPage, pController, *rAttrSet);
2138 m_aPreviewWin.SetLeftMargin(m_xBeforeMF->denormalize(m_xBeforeMF->get_value(FieldUnit::TWIP)));
2139 m_aPreviewWin.SetRightMargin(m_xAfterMF->denormalize(m_xAfterMF->get_value(FieldUnit::TWIP)));
2140 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 OUString &rName)
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
virtual short run() override
const SfxItemSet * GetOutputItemSet() const
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::Label > m_xFileNameFT
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::Label > m_xDDECommandFT
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 void PageCreated(const OUString &rId, SfxTabPage &rPage) override
virtual short Ok() override
void SetSectionData(SwSectionData const &rSect)
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
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
SwSectionPropertyTabDialog(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell &rSh)
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)