/* -*- 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 .
*/
// Add other styles of autoformat tables. for (sal_uInt8 i = 0, nCount = static_cast<sal_uInt8>(m_xTableTable->size());
i < nCount; i++)
{
SwTableAutoFormat const& rFormat = (*m_xTableTable)[ i ];
m_xLbFormat->append_text(rFormat.GetName().toString()); if (m_xTAutoFormat && rFormat.GetName() == m_xTAutoFormat->GetName())
m_lbIndex = i;
}
// Change this min variable if you add autotable manually.
minTableIndexInLb = 1;
maxTableIndexInLb = minTableIndexInLb + static_cast<sal_uInt8>(m_xTableTable->size()); // 1 means default table style // unfortunately when the table has a style sw/qa/uitest/writer_tests4/tdf115573.py fails // because tables that have pre-applied style resets the style of the elements in their cells // when a new row is inserted and the ui test above relies on that.
m_lbIndex = 0;
m_xLbFormat->select(m_lbIndex);
m_tbIndex = lbIndexToTableIndex(m_lbIndex);
IMPL_LINK_NOARG(SwInsTableDlg, SelFormatHdl, weld::TreeView&, void)
{ // Get index of selected item from the listbox
m_lbIndex = static_cast<sal_uInt8>(m_xLbFormat->get_selected_index());
m_tbIndex = lbIndexToTableIndex( m_lbIndex );
// To understand this index mapping, look InitAutoTableFormat function to // see how listbox item is implemented. if( m_tbIndex < 255 )
m_aWndPreview.NotifyChange( (*m_xTableTable)[m_tbIndex] ); else
{
SwTableAutoFormat aTmp( TableStyleName(SwViewShell::GetShellRes()->aStrNone) );
aTmp.DisableAll();
// We use weld::Entry's "changed" notification here, not weld::SpinButton's "value_changed", because // the latter only fires after the control looses focus; so the notification would not fire during // typing a big number, so that user typing it and immediately clicking "Insert" would not see the // warning. // Since the notification is called in weld::Entry context, we can only rely on what's available for // used weld::Entry's notification; specifically, we have to call spin buttons' get_text() instead // of get_value(), because the latter is not guaranteed to return an up-to-date value at this point // (depends on vcl plugin used).
IMPL_LINK( SwInsTableDlg, ModifyRowCol, weld::Entry&, rEdit, void )
{
sal_Int64 nRow = m_xRowSpinButton->get_text().toInt64();
sal_Int64 nCol = m_xColSpinButton->get_text().toInt64(); if (nRow > 255)
{
m_xRowSpinButton->set_message_type(weld::EntryMessageType::Warning);
m_xWarning->set_visible(true);
} else
{
m_xRowSpinButton->set_message_type(weld::EntryMessageType::Normal);
} if (nCol > 63)
{
m_xColSpinButton->set_message_type(weld::EntryMessageType::Warning);
m_xWarning->set_visible(true);
} else
{
m_xColSpinButton->set_message_type(weld::EntryMessageType::Normal);
} if (nRow <= 255 && nCol <= 63)
{
m_xWarning->set_visible(false);
} if (&rEdit == m_xColSpinButton.get()) return;
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.