Quellcode-Bibliothek contentcontroldlg.cxx
Sprache: C
/* -*- 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 .
*/
// Only 2 items would be visible by default.
m_xListItems->set_size_request(-1, m_xListItems->get_height_rows(8)); // Only the first column would have a non-zero size by default in the SvHeaderTabListBox case.
m_xListItems->set_column_fixed_widths({ 100, 100 });
if (!m_pContentControl->GetAlias().isEmpty())
{
m_xAlias->set_text(m_pContentControl->GetAlias());
m_xAlias->save_value();
}
if (!m_pContentControl->GetTag().isEmpty())
{
m_xTag->set_text(m_pContentControl->GetTag());
m_xTag->save_value();
}
// The ID is supposed to be a unique ID, but it isn't really used for much // and in MS Word it (supposedly) is automatically made unique if it is a duplicate. // The main purpose for having it here is lookup, not modification, // since AFAIK the only use of the ID is for VBA macro name lookup. // Since it is used as unsigned in VBA, make the UI display the unsigned values too.
m_xId->set_range(0, SAL_MAX_UINT32);
m_xId->set_increments(1, 10); const sal_uInt32 nId = static_cast<sal_uInt32>(m_pContentControl->GetId());
m_xId->set_value(nId); // a one-time chance to set the ID - only allow setting it when it is undefined. if (nId)
m_xId->set_editable(false); // still available for copy/paste
m_xId->save_value();
// And on the contrary, the tabIndex is stored as unsigned, // even though humanly speaking it is much nicer to use -1 to indicate a no tab stop. Oh well.
m_xTabIndex->set_range(SAL_MIN_INT32, SAL_MAX_INT32);
m_xTabIndex->set_increments(1, 10); const sal_Int32 nTabIndex = static_cast<sal_Int32>(m_pContentControl->GetTabIndex());
m_xTabIndex->set_value(nTabIndex);
m_xTabIndex->save_value();
if (m_pContentControl->GetComboBox() || m_pContentControl->GetDropDown())
{ for (constauto& rListItem : m_pContentControl->GetListItems())
{ int nRow = m_xListItems->n_children();
m_xListItems->append_text(rListItem.m_aDisplayText);
m_xListItems->set_text(nRow, rListItem.m_aValue, 1);
}
m_aSavedListItems = m_pContentControl->GetListItems();
} else
{
m_xListItemsFrame->set_visible(false);
m_xListItemButtons->set_visible(false);
}
if (m_pContentControl->GetDate())
{
m_xDateFormat->SetFormatType(SvNumFormatType::DATE);
m_xDateFormat->SetShowLanguageControl(true);
// Set height to double of the default.
weld::TreeView& rTreeView = dynamic_cast<weld::TreeView&>(m_xDateFormat->get_widget());
rTreeView.set_size_request(rTreeView.get_preferred_size().Width(),
rTreeView.get_height_rows(10));
¤ 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.17Bemerkung:
(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.