/* -*- 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 .
*/
switch ( eAlign )
{ case SfxChildAlignment::TOP: case SfxChildAlignment::HIGHESTTOP: case SfxChildAlignment::LOWESTTOP: case SfxChildAlignment::BOTTOM: case SfxChildAlignment::LOWESTBOTTOM: case SfxChildAlignment::HIGHESTBOTTOM:
{
eAlignment = eActAlign;
} break;
case SfxChildAlignment::LEFT: case SfxChildAlignment::RIGHT: case SfxChildAlignment::FIRSTLEFT: case SfxChildAlignment::LASTLEFT: case SfxChildAlignment::FIRSTRIGHT: case SfxChildAlignment::LASTRIGHT:
{
eAlignment = eAlign;
} break;
default:
{
eAlignment = eAlign;
} break;
}
return eAlignment;
}
// Set style buttons void SvxFontWorkDialog::SetStyle_Impl(const XFormTextStyleItem* pItem)
{ if ( pItem )
{
OUString sId = u"off"_ustr;
switch ( pItem->GetValue() )
{ case XFormTextStyle::Rotate : sId = "rotate"; break; case XFormTextStyle::Upright: sId = "upright"; break; case XFormTextStyle::SlantX : sId = "hori"; break; case XFormTextStyle::SlantY : sId = "vert"; break; default: ;//prevent warning
}
m_xTbxStyle->set_sensitive(true);
// Make sure that there is always exactly one checked toolbox item. if ( pItem->GetValue() == XFormTextStyle::NONE )
{
m_xTbxStyle->set_item_active(u"rotate"_ustr, false);
m_xTbxStyle->set_item_active(u"upright"_ustr, false);
m_xTbxStyle->set_item_active(u"hori"_ustr, false);
m_xTbxStyle->set_item_active(u"vert"_ustr, false);
// Enter X-value for shadow in edit field void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
{ if (!pItem || m_xMtrFldShadowX->has_focus()) return;
// #i19251# // The two involved fields/items are used double and contain/give different // values regarding to the access method. Thus, here we need to separate the access // methods regarding to the kind of value accessed. if (m_xTbxShadow->get_item_active(u"slant"_ustr))
{ // #i19251# // There is no value correction necessary at all, i think this // was only tried to be done without understanding that the two // involved fields/items are used double and contain/give different // values regarding to the access method. // nValue = nValue - ( int( float( nValue ) / 360.0 ) * 360 );
m_xMtrFldShadowX->set_value(pItem->GetValue(), FieldUnit::NONE);
} else
{
SetMetricValue(*m_xMtrFldShadowX, pItem->GetValue(), MapUnit::Map100thMM);
}
}
// Enter Y-value for shadow in edit field void SvxFontWorkDialog::SetShadowYVal_Impl(const XFormTextShadowYValItem* pItem)
{ if (!pItem || m_xMtrFldShadowY->has_focus()) return;
// #i19251# // The two involved fields/items are used double and contain/give different // values regarding to the access method. Thus, here we need to separate the access // methods regarding to the kind of value accessed. if (m_xTbxShadow->get_item_active(u"slant"_ustr))
{
m_xMtrFldShadowY->set_value(pItem->GetValue(), FieldUnit::NONE);
} else
{
SetMetricValue(*m_xMtrFldShadowY, pItem->GetValue(), MapUnit::Map100thMM);
}
}
IMPL_LINK(SvxFontWorkDialog, SelectStyleHdl_Impl, const OUString&, rId, void)
{ // Execute this block when a different toolbox item has been clicked or // when the off item has been clicked. The later is necessary to // override the toolbox behaviour of unchecking the item after second // click on it: One of the items has to be checked at all times (when // enabled that is.) if (rId != "off" && rId == m_sLastStyleTbxId) return;
IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimeoutHdl_Impl, Timer*, void)
{ // Possibly set the Metric system again. This should be done with a // listen, this is however not possible at the moment due to compatibility // issues. const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); if( eDlgUnit != m_xMtrFldDistance->get_unit() )
{
SetFieldUnit(*m_xMtrFldDistance, eDlgUnit, true);
SetFieldUnit(*m_xMtrFldTextStart, eDlgUnit, true); if (eDlgUnit == FieldUnit::MM)
{
m_xMtrFldDistance->set_increments(50, 500, FieldUnit::NONE);
m_xMtrFldTextStart->set_increments(50, 500, FieldUnit::NONE);
} else
{
m_xMtrFldDistance->set_increments(10, 100, FieldUnit::NONE);
m_xMtrFldTextStart->set_increments(10, 100, FieldUnit::NONE);
}
} if( eDlgUnit != m_xMtrFldShadowX->get_unit() &&
m_xTbxShadow->get_item_active(u"vertical"_ustr) )
{
SetFieldUnit(*m_xMtrFldShadowX, eDlgUnit, true);
SetFieldUnit(*m_xMtrFldShadowY, eDlgUnit, true);
// #i19251# // The two involved fields/items are used double and contain/give different // values regarding to the access method. Thus, here we need to separate the access // method regarding to the kind of value accessed. if (m_sLastShadowTbxId == "vertical")
{
nValueX = GetCoreValue(*m_xMtrFldShadowX, MapUnit::Map100thMM);
nValueY = GetCoreValue(*m_xMtrFldShadowY, MapUnit::Map100thMM);
} elseif (m_sLastShadowTbxId == "slant")
{
nValueX = m_xMtrFldShadowX->get_value(FieldUnit::NONE);
nValueY = m_xMtrFldShadowY->get_value(FieldUnit::NONE);
}
// Slot-ID does not matter, the Exec method evaluates the entire item set
GetBindings().GetDispatcher()->ExecuteList(SID_FORMTEXT_DISTANCE,
SfxCallMode::RECORD,
{ &aDistItem, &aStartItem, &aShadowXItem, &aShadowYItem });
}
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.