/* -*- 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 .
*/
if ( pDocShell )
pPool = pDocShell->GetStyleSheetPool();
OSL_ENSURE( pPool, "no Pool or no DocShell" );
if ( pPool )
{
pPool->First(pStyle->GetFamily()); // for SW - update internal list
}
if ( pStyle->GetName().isEmpty() && pPool )
{ // NullString as Name -> generate Name
OUString aNoName(SfxStyleDialogController::GenerateUnusedName(*pPool, pStyle->GetFamily()));
pStyle->SetName( aNoName );
aName = aNoName;
aFollow = pStyle->GetFollow();
aParent = pStyle->GetParent();
}
m_xName->set_text(pStyle->GetName());
// Set the field read-only if it is NOT an user-defined style // but allow selecting and copying if (pStyle->IsUserDefined())
{
m_xName->set_can_focus(true);
m_xName->set_editable(true);
m_xName->set_sensitive(true);
m_xName->grab_focus(); // tdf#142017 default to focus within the page, not in notebook tab
} else
{
m_xName->set_sensitive(false);
}
while ( pPoolStyle )
{ const OUString aStr( pPoolStyle->GetName() ); // own name as base template if ( aStr != aName )
m_xBaseLb->append_text(aStr);
pPoolStyle = pPool->Next();
}
After the change of a template name update the ListBox pBox
[Parameter]
ListBox* pBox ListBox, whose entries are to be updated const String& rNew the new Name
*/
{ if (pBox->get_sensitive())
{ // it is the current entry, which name was modified constbool bSelect = pBox->get_active_text() == aBuf; int nOldIndex = pBox->find_text(aBuf); if (nOldIndex != -1)
pBox->remove(nOldIndex);
pBox->append_text(rNew);
switch ( eFieldUnit )
{ case FieldUnit::MM: eUnit = MapUnit::MapMM; break; case FieldUnit::CM: case FieldUnit::M: case FieldUnit::KM: eUnit = MapUnit::MapCM; break; case FieldUnit::POINT: case FieldUnit::PICA: eUnit = MapUnit::MapPoint; break; case FieldUnit::INCH: case FieldUnit::FOOT: case FieldUnit::MILE: eUnit = MapUnit::MapInch; break;
default:
OSL_FAIL( "non supported field unit" );
}
m_xDescFt->set_label(pStyle->GetDescription(eUnit));
}
StarView Handler; lose-focus-handler of the edits of the template name. This will update the listbox with the subsequent templates. The current template itself is not returned in the listbox of the base templates.
*/
{
weld::Entry& rEdit = dynamic_cast<weld::Entry&>(rControl); const OUString aStr(comphelper::string::stripStart(rEdit.get_text(), ' '));
rEdit.set_text(aStr); // Update the Listbox of the base template if possible if ( aStr != aBuf )
UpdateName_Impl(m_xFollowLb.get(), aStr);
}
if ( SfxResId(STR_STANDARD) == aName )
{ // the default template can not be linked
m_xBaseFt->set_sensitive(false);
m_xBaseLb->set_sensitive(false);
}
} else
m_xEditLinkStyleBtn->set_sensitive( false );
if (m_xFilterLb->get_sensitive())
{
SfxStyleSearchBits nCmp = pStyle->GetMask();
ActivatePage handler of SfxTabDialog, is used for the update of the descriptive text, since this might have changed through changes of data on other pages.
[Parameter]
const SfxItemSet& the set for the exchange of data; is not used here.
DeactivatePage-handler of SfxTabDialog; data is set on the template, so that the correct inheritance on the other pages of the dialog is made. If an error occurs, leaving the page is prevented. [Parameter]
SfxItemSet* the set for the exchange of data; is not used here.
[Cross-reference]
<SfxTabDialog::DeactivatePage(SfxItemSet*)>
*/
{
DeactivateRC nRet = DeactivateRC::LeavePage;
if (m_xName->get_value_changed_from_saved())
{ // By pressing <Enter> LoseFocus() is not triggered through StarView if (m_xName->has_focus())
LoseFocusHdl( *m_xName );
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.