/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// Handler for Change Page Number
IMPL_LINK(SwBreakDlg, PageNumHdl, weld::Toggleable&, rBox, void)
{ if (rBox.get_active())
m_xPageNumEdit->set_value(1); else
m_xPageNumEdit->set_text(OUString());
}
// By changing the Page number the checkbox is checked.
IMPL_LINK_NOARG(SwBreakDlg, PageNumModifyHdl, weld::SpinButton&, void)
{
m_xPageNumBox->set_active(true);
}
/* * Ok-Handler; * checks whether pagenumber nPage is a legal pagenumber (left pages with even * numbers etc. for a page template with alternating pages)
*/
IMPL_LINK_NOARG(SwBreakDlg, OkHdl, weld::Button&, void)
{ if (m_xPageNumBox->get_active())
{ // In case of differing page descriptions, test validity constint nPos = m_xPageCollBox->get_active(); // position 0 says 'Without'. const SwPageDesc *pPageDesc; if (nPos != 0 && nPos != -1)
pPageDesc = m_rSh.FindPageDescByName(UIName(m_xPageCollBox->get_active_text()), true); else
pPageDesc = &m_rSh.GetPageDesc(m_rSh.GetCurPageDesc());
assert(pPageDesc && "Page description not found."); const sal_uInt16 nUserPage = sal_uInt16(m_xPageNumEdit->get_value()); bool bOk = true; switch(pPageDesc->GetUseOn())
{ case UseOnPage::Mirror: case UseOnPage::All: break; case UseOnPage::Left: bOk = 0 == nUserPage % 2; break; case UseOnPage::Right: bOk = 1 == nUserPage % 2; break; default:; //prevent warning
} if(!bOk)
{
std::unique_ptr<weld::Dialog> xDialog(Application::CreateMessageDialog(m_xPageNumEdit.get(), VclMessageType::Info,
VclButtonsType::Ok, SwResId(STR_ILLEGAL_PAGENUM)));
xDialog->run();
m_xPageNumEdit->grab_focus(); return;
}
}
rememberResult();
m_xDialog->response(RET_OK);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.