/* -*- 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 .
*/
void OPropertyEditor::CommitModified()
{ // commit all of my pages, if necessary for (constauto& page : m_aShownPages)
{
OBrowserPage* pPage = page.second.xPage.get(); if (pPage && pPage->getListBox().IsModified() )
pPage->getListBox().CommitModified();
}
}
sal_uInt16 OPropertyEditor::AppendPage(const OUString& rText, const OUString& rHelpId)
{ // obtain a new id
sal_uInt16 nId = m_nNextId++; // insert the id
OUString sIdent = OUString::number(nId);
m_xTabControl->append_page(sIdent, rText);
// create a new page auto xPage = std::make_unique<OBrowserPage>(m_xTabControl->get_page(sIdent), m_xControlHoldingParent.get()); // some knittings
xPage->getListBox().SetListener(m_pListener);
xPage->getListBox().SetObserver(m_pObserver);
xPage->getListBox().EnableHelpSection(m_bHasHelpSection);
xPage->SetHelpId(rHelpId);
void OPropertyEditor::InsertEntry( const OLineDescriptor& rData, sal_uInt16 nPageId, sal_uInt16 nPos )
{ // let the current page handle this
OBrowserPage* pPage = getPage(nPageId);
DBG_ASSERT( pPage, "OPropertyEditor::InsertEntry: don't have such a page!" ); if ( !pPage ) return;
pPage->getListBox().InsertEntry( rData, nPos );
OSL_ENSURE( m_aPropertyPageIds.find( rData.sName ) == m_aPropertyPageIds.end(), "OPropertyEditor::InsertEntry: property already present in the map!" );
m_aPropertyPageIds.emplace( rData.sName, nPageId );
}
IMPL_LINK(OPropertyEditor, OnPageDeactivate, const OUString&, rIdent, bool)
{ // commit the data on the current (to-be-deactivated) tab page // (79404)
OBrowserPage* pCurrentPage = getPage(rIdent.toUInt32()); if (!pCurrentPage) returntrue;
if (pCurrentPage->getListBox().IsModified())
pCurrentPage->getListBox().CommitModified();
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.