30#include <bitmaps.hlst>
41 : GenericDialogController(pWindow,
"modules/simpress/ui/slidedesigndialog.ui",
"SlideDesignDialog")
43 , mrOutAttrs(rInAttrs)
45 , m_xCbxMasterPage(m_xBuilder->weld_check_button(
"masterpage"))
46 , m_xCbxCheckMasters(m_xBuilder->weld_check_button(
"checkmasters"))
47 , m_xBtnLoad(m_xBuilder->weld_button(
"load"))
48 , m_xVS(new
ValueSet(m_xBuilder->weld_scrolled_window(
"selectwin", true)))
49 , m_xVSWin(new
weld::CustomWeld(*m_xBuilder,
"select", *m_xVS))
50 ,
m_xLabel(m_xBuilder->weld_label(
"label1"))
85 bool bMasterPage = pPoolItem->GetValue();
94 maName = pPoolItem->GetValue();
108 m_xVS->SelectItem(
static_cast<sal_uInt16
>(nName) + 1);
117 short nId =
m_xVS->GetSelectedItemId();
121 OUString aLayoutName;
147 m_xVS->SetColCount(2);
148 m_xVS->SetLineCount(2);
149 m_xVS->SetExtraSpacing(2);
155 for (sal_uInt16 nLayout = 0; nLayout <
nCount; nLayout++)
161 aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(
SD_LT_SEPARATOR));
165 m_xVS->InsertItem(
static_cast<sal_uInt16
>(
maLayoutNames.size()), aBitmap, aLayoutName);
187 aDlg.set_title(
SdResId(STR_LOAD_DRAWING_LAYOUT));
189 aDlg.set_title(
SdResId(STR_LOAD_PRESENTATION_LAYOUT));
190 sal_uInt16 nResult = aDlg.run();
192 bool bCancel =
false;
218 OUString aCompareStr(
maName);
219 if (aCompareStr.isEmpty())
220 aCompareStr = maStrNone;
222 auto it = std::find(maLayoutNames.begin(), maLayoutNames.end(), aCompareStr);
223 if (it != maLayoutNames.end())
225 sal_uInt16 aPos =
static_cast<sal_uInt16
>(std::distance(maLayoutNames.begin(), it));
227 m_xVS->SelectItem( aPos + 1 );
244 for (sal_uInt16 nLayout = 0; nLayout <
nCount; nLayout++)
250 aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(
SD_LT_SEPARATOR));
251 maLayoutNames.push_back(aLayoutName);
254 m_xVS->InsertItem(
static_cast<sal_uInt16
>(maLayoutNames.size()), aBitmap, aLayoutName);
268 maLayoutNames.push_back(maStrNone);
269 m_xVS->InsertItem(
static_cast<sal_uInt16
>(maLayoutNames.size()),
270 Image(BMP_SLIDE_NONE), maStrNone );
276 m_xVS->SelectItem(
static_cast<sal_uInt16
>(maLayoutNames.size()) );
Reference< XExecutableDialog > m_xDialog
SdDrawDocument * OpenBookmarkDoc(const OUString &rBookmarkFile)
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SAL_DLLPRIVATE DocumentType GetDocumentType() const
PageKind GetPageKind() const
virtual OUString GetLayoutName() const override
SdPresLayoutDlg(::sd::DrawDocShell *pDocShell, weld::Window *pWindow, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::Button > m_xBtnLoad
std::unique_ptr< weld::Label > m_xLabel
std::unique_ptr< weld::CustomWeld > m_xVSWin
std::unique_ptr< weld::CheckButton > m_xCbxMasterPage
tools::Long mnLayoutCount
number of master pages in the document
void GetAttr(SfxItemSet &rOutAttrs)
Fills the provided Item-Set with dialog box attributes.
std::unique_ptr< weld::CheckButton > m_xCbxCheckMasters
void FillValueSet()
Fills ValueSet with bitmaps.
std::vector< OUString > maLayoutNames
::sd::DrawDocShell * mpDocSh
const SfxItemSet & mrOutAttrs
virtual ~SdPresLayoutDlg() override
std::unique_ptr< ValueSet > m_xVS
OUString maName
layout name or file name
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
sal_uInt16 GetMasterPageCount() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OUString GetTemplateFileName() const
std::unique_ptr< weld::Label > m_xLabel
BitmapEx GetPagePreviewBitmap(SdPage *pPage)
Creates a bitmap of an arbitrary page.
SdDrawDocument * GetDoc()
std::shared_ptr< weld::Dialog > m_xDialog
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral SD_LT_SEPARATOR
#define LINK(Instance, Class, Member)
OUString SdResId(TranslateId aId)
IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl, ValueSet *, void)
DoubleClick handler.