You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2013/05/31 15:56:04 UTC
svn commit: r1488227 [13/15] - in /openoffice/branches/rejuvenate01: ./
ext_libraries/apr/ ext_libraries/apr/prj/ ext_libraries/coinmp/prj/
ext_libraries/ratscan/prj/ ext_libraries/serf/prj/ main/
main/basctl/source/dlged/ main/basctl/uiconfig/basicide...
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.cxx Fri May 31 13:55:58 2013
@@ -23,15 +23,16 @@
#include "InsertPropertyPanel.hxx"
#include "InsertPropertyPanel.hrc"
-#include "SimpleToolBoxController.hxx"
#include "sfx2/sidebar/CommandInfoProvider.hxx"
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
+#include <sfx2/sidebar/ControllerFactory.hxx>
#include <svx/dialmgr.hxx>
#include <svtools/miscopt.hxx>
+#include <svtools/generictoolboxcontroller.hxx>
#include <vcl/toolbox.hxx>
#include <sfx2/tbxctrl.hxx>
#include <framework/sfxhelperfunctions.hxx>
@@ -45,6 +46,7 @@
using namespace css;
using namespace cssu;
using ::rtl::OUString;
+using ::sfx2::sidebar::SidebarToolBox;
namespace svx { namespace sidebar {
@@ -56,20 +58,17 @@ InsertPropertyPanel::InsertPropertyPanel
mpStandardShapesBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
mpStandardShapesToolBox(sfx2::sidebar::ControlFactory::CreateToolBox(
mpStandardShapesBackground.get(),
- SVX_RES(TB_INSERT_STANDARD))),
+ SVX_RES(TB_INSERT_STANDARD),
+ rxFrame)),
mpCustomShapesBackground(sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this)),
mpCustomShapesToolBox(sfx2::sidebar::ControlFactory::CreateToolBox(
mpCustomShapesBackground.get(),
- SVX_RES(TB_INSERT_CUSTOM))),
- maControllers(),
+ SVX_RES(TB_INSERT_CUSTOM),
+ rxFrame)),
mxFrame(rxFrame)
{
- SetupToolBox(*mpStandardShapesToolBox);
- SetupToolBox(*mpCustomShapesToolBox);
FreeResource();
- UpdateIcons();
-
mpStandardShapesToolBox->Show();
mpCustomShapesToolBox->Show();
@@ -85,17 +84,6 @@ InsertPropertyPanel::InsertPropertyPanel
InsertPropertyPanel::~InsertPropertyPanel (void)
{
- ControllerContainer aControllers;
- aControllers.swap(maControllers);
- for (ControllerContainer::iterator iController(aControllers.begin()), iEnd(aControllers.end());
- iController!=iEnd;
- ++iController)
- {
- Reference<lang::XComponent> xComponent (iController->second.mxController, UNO_QUERY);
- if (xComponent.is())
- xComponent->dispose();
- }
-
// Remove window child listener.
Window* pTopWindow = this;
while (pTopWindow->GetParent() != NULL)
@@ -111,88 +99,6 @@ InsertPropertyPanel::~InsertPropertyPane
-void InsertPropertyPanel::SetupToolBox (ToolBox& rToolBox)
-{
- const sal_uInt16 nItemCount (rToolBox.GetItemCount());
- for (sal_uInt16 nItemIndex=0; nItemIndex<nItemCount; ++nItemIndex)
- CreateController(rToolBox.GetItemId(nItemIndex));
-
- rToolBox.SetDropdownClickHdl(LINK(this, InsertPropertyPanel, DropDownClickHandler));
- rToolBox.SetClickHdl(LINK(this, InsertPropertyPanel, ClickHandler));
- rToolBox.SetDoubleClickHdl(LINK(this, InsertPropertyPanel, DoubleClickHandler));
- rToolBox.SetSelectHdl(LINK(this, InsertPropertyPanel, SelectHandler));
- rToolBox.SetActivateHdl(LINK(this, InsertPropertyPanel, Activate));
- rToolBox.SetDeactivateHdl(LINK(this, InsertPropertyPanel, Deactivate));
-
- rToolBox.SetSizePixel(rToolBox.CalcWindowSizePixel());
-}
-
-
-
-
-IMPL_LINK(InsertPropertyPanel, DropDownClickHandler, ToolBox*, pToolBox)
-{
- if (pToolBox != NULL)
- {
- Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
- if (xController.is())
- {
- Reference<awt::XWindow> xWindow = xController->createPopupWindow();
- if (xWindow.is() )
- xWindow->setFocus();
- }
- }
- return 1;
-}
-
-
-
-
-IMPL_LINK(InsertPropertyPanel, ClickHandler, ToolBox*, pToolBox)
-{
- if (pToolBox == NULL)
- return 0;
-
- Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
- if (xController.is())
- xController->click();
-
- return 1;
-}
-
-
-
-
-IMPL_LINK(InsertPropertyPanel, DoubleClickHandler, ToolBox*, pToolBox)
-{
- if (pToolBox == NULL)
- return 0;
-
- Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
- if (xController.is())
- xController->doubleClick();
-
- return 1;
-}
-
-
-
-
-IMPL_LINK(InsertPropertyPanel, SelectHandler, ToolBox*, pToolBox)
-{
- if (pToolBox == NULL)
- return 0;
-
- Reference<frame::XToolbarController> xController (GetControllerForItemId(pToolBox->GetCurItemId()));
- if (xController.is())
- xController->execute((sal_Int16)pToolBox->GetModifier());
-
- return 1;
-}
-
-
-
-
IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
{
// We will be getting a lot of window events (well, basically all
@@ -205,7 +111,8 @@ IMPL_LINK(InsertPropertyPanel, WindowEve
if (pEvent->GetId() != VCLEVENT_TOOLBOX_SELECT)
return 1;
- ToolBox* pToolBox = dynamic_cast<ToolBox*>(dynamic_cast<VclWindowEvent*>(pEvent)->GetWindow());
+ Window* pWindow = dynamic_cast<VclWindowEvent*>(pEvent)->GetWindow();
+ ToolBox* pToolBox = dynamic_cast<ToolBox*>(pWindow);
if (pToolBox == NULL)
return 1;
@@ -222,196 +129,29 @@ IMPL_LINK(InsertPropertyPanel, WindowEve
if (nId == 0)
return 1;
- // Get toolbar controller.
- const sal_uInt16 nItemId (GetItemIdForSubToolbarName(aURL.Path));
- Reference<frame::XSubToolbarController> xController (GetControllerForItemId(nItemId), UNO_QUERY);
+ SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox.get());
+ if (pSidebarToolBox == NULL)
+ return 1;
+ sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path));
+ if (nItemId == 0)
+ {
+ pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox.get());
+ if (pSidebarToolBox == NULL)
+ return 1;
+ nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path);
+ if (nItemId == 0)
+ return 1;
+ }
+
+ Reference<frame::XSubToolbarController> xController (pSidebarToolBox->GetControllerForItemId(nItemId), UNO_QUERY);
if ( ! xController.is())
return 1;
const OUString sCommand (pToolBox->GetItemCommand(nId));
- ControllerContainer::iterator iController (maControllers.find(nItemId));
- if (iController != maControllers.end())
- iController->second.msCurrentCommand = sCommand;
xController->functionSelected(sCommand);
- const sal_Bool bBigImages (SvtMiscOptions().AreCurrentSymbolsLarge());
- const bool bIsHighContrastActive (sfx2::sidebar::Theme::IsHighContrastMode());
- Image aImage (framework::GetImageFromURL(mxFrame, sCommand, bBigImages, bIsHighContrastActive));
- pToolBox->SetItemImage(iController->first, aImage);
-
- return 1;
-}
-
-
-
-
-IMPL_LINK(InsertPropertyPanel, Activate, ToolBox*, EMPTYARG)
-{
return 1;
}
-
-
-IMPL_LINK(InsertPropertyPanel, Deactivate, ToolBox*, EMPTYARG)
-{
- return 1;
-}
-
-
-
-
-void InsertPropertyPanel::CreateController (
- const sal_uInt16 nItemId)
-{
- ToolBox* pToolBox = GetToolBoxForItemId(nItemId);
- if (pToolBox != NULL)
- {
- ItemDescriptor aDescriptor;
-
- const OUString sCommandName (pToolBox->GetItemCommand(nItemId));
-
- // Create a controller for the new item.
- aDescriptor.mxController.set(
- static_cast<XWeak*>(::framework::CreateToolBoxController(
- mxFrame,
- pToolBox,
- nItemId,
- sCommandName)),
- UNO_QUERY);
- if ( ! aDescriptor.mxController.is())
- aDescriptor.mxController.set(
- static_cast<XWeak*>(new SimpleToolBoxController(mxFrame, *pToolBox, nItemId, sCommandName)),
- UNO_QUERY);
- if ( ! aDescriptor.mxController.is())
- return;
-
- // Get dispatch object for the command.
- aDescriptor.maURL = sfx2::sidebar::Tools::GetURL(sCommandName);
- aDescriptor.msCurrentCommand = sCommandName;
- aDescriptor.mxDispatch = sfx2::sidebar::Tools::GetDispatch(mxFrame, aDescriptor.maURL);
- if ( ! aDescriptor.mxDispatch.is())
- return;
-
- // Initialize the controller with eg a service factory.
- Reference<lang::XInitialization> xInitialization (aDescriptor.mxController, UNO_QUERY);
- if (xInitialization.is())
- {
- beans::PropertyValue aPropValue;
- std::vector<Any> aPropertyVector;
-
- aPropValue.Name = A2S("Frame");
- aPropValue.Value <<= mxFrame;
- aPropertyVector.push_back(makeAny(aPropValue));
-
- aPropValue.Name = A2S("ServiceManager");
- aPropValue.Value <<= ::comphelper::getProcessServiceFactory();
- aPropertyVector.push_back(makeAny(aPropValue));
-
- aPropValue.Name = A2S("CommandURL");
- aPropValue.Value <<= sCommandName;
- aPropertyVector.push_back(makeAny(aPropValue));
-
- Sequence<Any> aArgs (comphelper::containerToSequence(aPropertyVector));
- xInitialization->initialize(aArgs);
- }
-
- Reference<util::XUpdatable> xUpdatable (aDescriptor.mxController, UNO_QUERY);
- if (xUpdatable.is())
- xUpdatable->update();
-
- // Add label.
- const OUString sLabel (sfx2::sidebar::CommandInfoProvider::Instance().GetLabelForCommand(
- sCommandName,
- mxFrame));
- pToolBox->SetQuickHelpText(nItemId, sLabel);
-
- // Add item to toolbox.
- pToolBox->EnableItem(nItemId);
- maControllers.insert(::std::make_pair(nItemId, aDescriptor));
- }
-}
-
-
-
-
-ToolBox* InsertPropertyPanel::GetToolBoxForItemId (const sal_uInt16 nItemId) const
-{
- switch(nItemId)
- {
- case TBI_STANDARD_LINE:
- case TBI_STANDARD_ARROW:
- case TBI_STANDARD_RECTANGLE:
- case TBI_STANDARD_ELLIPSE:
- case TBI_STANDARD_TEXT:
- case TBI_STANDARD_LINES:
- case TBI_STANDARD_CONNECTORS:
- case TBI_STANDARD_ARROWS:
- return mpStandardShapesToolBox.get();
-
- case TBI_CUSTOM_BASICS:
- case TBI_CUSTOM_SYMBOLS:
- case TBI_CUSTOM_ARROWS:
- case TBI_CUSTOM_FLOWCHARTS:
- case TBI_CUSTOM_CALLOUTS:
- case TBI_CUSTOM_STARS:
- return mpCustomShapesToolBox.get();
-
- default:
- return NULL;
- }
-}
-
-
-
-
-Reference<frame::XToolbarController> InsertPropertyPanel::GetControllerForItemId (const sal_uInt16 nItemId) const
-{
- ControllerContainer::const_iterator iController (maControllers.find(nItemId));
- if (iController != maControllers.end())
- return iController->second.mxController;
- else
- return NULL;
-}
-
-
-
-
-sal_uInt16 InsertPropertyPanel::GetItemIdForSubToolbarName (const OUString& rsSubToolbarName) const
-{
- for (ControllerContainer::const_iterator iController(maControllers.begin()), iEnd(maControllers.end());
- iController!=iEnd;
- ++iController)
- {
- Reference<frame::XSubToolbarController> xSubToolbarController (iController->second.mxController, UNO_QUERY);
- if (xSubToolbarController.is())
- if (xSubToolbarController->getSubToolbarName().equals(rsSubToolbarName))
- return iController->first;
- }
- return NULL;
-}
-
-
-
-
-void InsertPropertyPanel::UpdateIcons (void)
-{
- const sal_Bool bBigImages (SvtMiscOptions().AreCurrentSymbolsLarge());
- const bool bIsHighContrastActive (sfx2::sidebar::Theme::IsHighContrastMode());
-
- for (ControllerContainer::iterator iController(maControllers.begin()), iEnd(maControllers.end());
- iController!=iEnd;
- ++iController)
- {
- const ::rtl::OUString sCommandURL (iController->second.msCurrentCommand);
- Image aImage (framework::GetImageFromURL(mxFrame, sCommandURL, bBigImages, bIsHighContrastActive));
- ToolBox* pToolBox = GetToolBoxForItemId(iController->first);
- if (pToolBox != NULL)
- pToolBox->SetItemImage(iController->first, aImage);
- }
-}
-
-
-
-
} } // end of namespace svx::sidebar
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/insert/InsertPropertyPanel.hxx Fri May 31 13:55:58 2013
@@ -39,6 +39,8 @@ class ToolBox;
namespace svx { namespace sidebar {
+/** This panel provides buttons for inserting shapes into a document.
+*/
class InsertPropertyPanel
: public Control
{
@@ -49,45 +51,13 @@ public:
virtual ~InsertPropertyPanel (void);
private:
- ::boost::scoped_ptr<Window> mpStandardShapesBackground;
+ ::boost::scoped_ptr<Window> mpStandardShapesBackground;
::boost::scoped_ptr<ToolBox> mpStandardShapesToolBox;
- ::boost::scoped_ptr<Window> mpCustomShapesBackground;
+ ::boost::scoped_ptr<Window> mpCustomShapesBackground;
::boost::scoped_ptr<ToolBox> mpCustomShapesToolBox;
- class ItemDescriptor
- {
- public:
- cssu::Reference<css::frame::XToolbarController> mxController;
- css::util::URL maURL;
- rtl::OUString msCurrentCommand;
- cssu::Reference<css::frame::XDispatch> mxDispatch;
- };
- typedef ::std::map<sal_uInt16, ItemDescriptor> ControllerContainer;
- ControllerContainer maControllers;
const cssu::Reference<css::frame::XFrame> mxFrame;
-
- /** Add listeners to toolbox and update its size to match its
- content.
- */
- void SetupToolBox (ToolBox& rToolBox);
- cssu::Reference<css::frame::XToolbarController> GetControllerForItemId (
- const sal_uInt16 nItemId) const;
- ToolBox* GetToolBoxForItemId (const sal_uInt16 nItemId) const;
- sal_uInt16 GetItemIdForSubToolbarName (
- const ::rtl::OUString& rsCOmmandName) const;
- /** Create toolbox controller for one item.
- */
- void CreateController (
- const sal_uInt16 nItemId);
- void UpdateIcons (void);
-
- DECL_LINK(DropDownClickHandler, ToolBox*);
- DECL_LINK(ClickHandler, ToolBox*);
- DECL_LINK(DoubleClickHandler, ToolBox*);
- DECL_LINK(SelectHandler, ToolBox*);
DECL_LINK(WindowEventListener, VclSimpleEvent*);
- DECL_LINK(Activate, ToolBox*);
- DECL_LINK(Deactivate, ToolBox*);
};
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/nbdtmg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/nbdtmg.cxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/nbdtmg.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/nbdtmg.cxx Fri May 31 13:55:58 2013
@@ -386,7 +386,6 @@ sal_uInt16 BulletsTypeMgr::GetNBOIndexFo
SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
sal_Unicode cChar = aFmt.GetBulletChar();
- const Font* pFont = aFmt.GetBulletFont();
//sal_uInt16 nLength = 0;
/*if( Application::GetSettings().GetLayoutRTL() )
{
@@ -479,7 +478,7 @@ sal_Bool BulletsTypeMgr::RelplaceNumRule
return sal_True;
}
-sal_Bool BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
+sal_Bool BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool /* isDefault */,sal_Bool isResetSize)
{
//if ( mLevel == (sal_uInt16)0xFFFF )
// return sal_False;
@@ -530,7 +529,7 @@ sal_Bool BulletsTypeMgr::ApplyNumRule(Sv
return sal_True;
}
-String BulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool isDefault)
+String BulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool /* isDefault */)
{
String sRet;
//sal_uInt16 nLength = 0;
@@ -658,7 +657,7 @@ void GraphyicBulletsTypeMgr::Init()
aGrfDataLst.Insert( pEntry, LIST_APPEND );
}
}
-sal_uInt16 GraphyicBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
+sal_uInt16 GraphyicBulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 /* nFromIndex */)
{
if ( mLevel == (sal_uInt16)0xFFFF || mLevel == 0)
return (sal_uInt16)0xFFFF;
@@ -676,7 +675,6 @@ sal_uInt16 GraphyicBulletsTypeMgr::GetNB
if ( pGrf )
{
- const String* pGrfName = pBrsh->GetGraphicLink();
Graphic aGraphic;
for(sal_uInt16 i=0;i<aGrfDataLst.Count();i++)
{
@@ -743,7 +741,7 @@ sal_Bool GraphyicBulletsTypeMgr::Relplac
return sal_True;
}
-sal_Bool GraphyicBulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
+sal_Bool GraphyicBulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool /* isDefault */,sal_Bool /* isResetSize */)
{
//if ( mLevel == (sal_uInt16)0xFFFF )
// return sal_False;
@@ -788,7 +786,7 @@ sal_Bool GraphyicBulletsTypeMgr::ApplyNu
return sal_True;
}
-String GraphyicBulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool isDefault)
+String GraphyicBulletsTypeMgr::GetDescription(sal_uInt16 nIndex,sal_Bool /* isDefault */)
{
String sRet;
sal_uInt16 nLength = 0;
@@ -1054,8 +1052,6 @@ sal_uInt16 MixBulletsTypeMgr::GetNBOInde
if ( pGrf )
{
- const String* pGrfName = pBrsh->GetGraphicLink();
- //String* pGrfName = (String*)(pBrsh->GetGraphicLink());
for(sal_uInt16 i = nFromIndex; i < DEFAULT_BULLET_TYPES; i++)
{
if ( pActualBullets[i]->eType == eNBType::GRAPHICBULLETS )
@@ -1537,8 +1533,6 @@ sal_uInt16 NumberingTypeMgr::GetNBOIndex
return (sal_uInt16)0xFFFF;
SvxNumberFormat aFmt(aNum.GetLevel(nActLv));
- sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0];
- sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0];
String sPreFix = aFmt.GetPrefix();
String sSuffix = aFmt.GetSuffix();
String sEmpty;
@@ -1786,7 +1780,7 @@ void OutlineTypeMgr::Init()
}
}
-sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex)
+sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /* mLevel */,sal_uInt16 nFromIndex)
{
sal_uInt16 nLength = sizeof(pOutlineSettingsArrs)/sizeof(OutlineSettings_Impl*);
for(sal_uInt16 iDex = nFromIndex; iDex < nLength; iDex++)
@@ -1798,12 +1792,8 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexFo
{
NumSettings_ImplPtr _pSet = pItemArr->pNumSettingsArr->GetObject(iLevel);
sal_Int16 eNType = _pSet->nNumberType;
- const sal_Unicode cLocalPrefix = _pSet->sPrefix.getLength() ? _pSet->sPrefix.getStr()[0] : 0;
- const sal_Unicode cLocalSuffix = _pSet->sSuffix.getLength() ? _pSet->sSuffix.getStr()[0] : 0;
SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
- sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0];
- sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0];
String sPreFix = aFmt.GetPrefix();
String sSuffix = aFmt.GetSuffix();
String sEmpty;
@@ -1811,7 +1801,6 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexFo
if( eNumType == SVX_NUM_CHAR_SPECIAL)
{
sal_Unicode cChar = aFmt.GetBulletChar();
- const Font* pFont = aFmt.GetBulletFont();
sal_Unicode ccChar = _pSet->sBulletChar.getStr()[0];
rtl::OUString sFont = _pSet->sBulletFont;
if ( !((cChar == ccChar) && //pFont && sFont.compareTo(pFont->GetName()) &&
@@ -1881,8 +1870,6 @@ sal_Bool OutlineTypeMgr::RelplaceNumRule
for (sal_uInt16 iLevel=0;iLevel < nCount;iLevel++)
{
SvxNumberFormat aFmt(aNum.GetLevel(iLevel));
- sal_Unicode cPrefix = rtl::OUString(aFmt.GetPrefix()).getStr()[0];
- sal_Unicode cSuffix = rtl::OUString(aFmt.GetSuffix()).getStr()[0];
sal_Int16 eNumType = aFmt.GetNumberingType();
NumSettings_ImplPtr _pSet = pItemArr->pNumSettingsArr->GetObject(iLevel);
@@ -1939,7 +1926,7 @@ sal_Bool OutlineTypeMgr::RelplaceNumRule
return sal_True;
}
-sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 mLevel,sal_Bool isDefault,sal_Bool isResetSize)
+sal_Bool OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum,sal_uInt16 nIndex,sal_uInt16 /* mLevel */,sal_Bool isDefault,sal_Bool isResetSize)
{
//if ( mLevel == (sal_uInt16)0xFFFF )
// return sal_False;
@@ -1958,7 +1945,6 @@ sal_Bool OutlineTypeMgr::ApplyNumRule(Sv
NumSettings_ImplPtr pLevelSettings = 0;
String sBulletCharFmtName = GetBulCharFmtName();
- sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < aNum.GetLevelCount(); i++)
{
if(pNumSettingsArr->Count() > i)
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx Fri May 31 13:55:58 2013
@@ -67,7 +67,6 @@ maSpacing1 (SVX_RES(IMG_SPACING1))
maSpacing115 (SVX_RES(IMG_SPACING115)),
maSpacing15 (SVX_RES(IMG_SPACING15)),
maSpacing2 (SVX_RES(IMG_SPACING2)),
-maLPCustom (SVX_RES(IMG_SPACINGLCUSTOM)),
maSelSpacing1 (SVX_RES(IMG_SEL_SPACING1)),
maSelSpacing115 (SVX_RES(IMG_SEL_SPACING115)),
maSelSpacing15 (SVX_RES(IMG_SEL_SPACING15)),
@@ -105,76 +104,64 @@ ParaLineSpacingControl::~ParaLineSpacing
void ParaLineSpacingControl::initial()
{
- //maLineSpacing.SetStyle( maLineSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
- //maLineSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
- //maLineSpacing.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
- //maLineSpacing.SetMinFont();
-
- maLineSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
- sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maLineSpacing.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
- sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maLineSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
- sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- //maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- //GetSettings().GetStyleSettings().GetMenuColor():
- //sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- //maFTBy.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- //GetSettings().GetStyleSettings().GetMenuColor():
- //sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
-
- mpImg = new Image[4];
- mpImg[0] = maSpacing1;
- mpImg[1] = maSpacing115;
- mpImg[2] = maSpacing15;
- mpImg[3] = maSpacing2;
-
- mpImgSel = new Image[4];
- mpImgSel[0] = maSelSpacing1;
- mpImgSel[1] = maSelSpacing115;
- mpImgSel[2] = maSelSpacing15;
- mpImgSel[3] = maSelSpacing2;
-
- mpStr = new XubString[4];
- mpStr[0] = XubString(SVX_RES(STR_SPACING1));
- mpStr[1] = XubString(SVX_RES(STR_SPACING115));
- mpStr[2] = XubString(SVX_RES(STR_SPACING15));
- mpStr[3] = XubString(SVX_RES(STR_SPACING2));
-
- mpStrTip = new XubString[4];
- mpStrTip[0] = XubString(SVX_RES(STR_LS_SINGLE));
- mpStrTip[1] = XubString(SVX_RES(STR_LS_115));
- mpStrTip[2] = XubString(SVX_RES(STR_LS_15));
- mpStrTip[3] = XubString(SVX_RES(STR_LS_DOUBLE));
- for (int i=0;i<4;i++)
- maLineSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
-
- maLineSpacing.AddItem( maImgCus, 0, maStrCus, 0 );
-
- SetAllNoSel();
- Link aLink = LINK(this, ParaLineSpacingControl,VSSelHdl );
- maLineSpacing.SetSelectHdl(aLink);
- maLineSpacing.StartSelection();
- maLineSpacing.Show();
+ maLineSpacing.SetStyle( maLineSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
- aLink = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl );
- aLineDist.SetSelectHdl(aLink);
- aLineDist.SelectEntryPos( LLINESPACE_1 ) ;
- aLink = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl );
- aLineDistAtPercentBox.SetModifyHdl( aLink );
- aLineDistAtMetricBox.SetModifyHdl( aLink );
-}
-void ParaLineSpacingControl::ToGetFocus(bool bType)
-{
- if(!bType)
- aLineDist.GrabFocus();
- else
- maLineSpacing.GrabFocus(); //wj
+ maLineSpacing.SetControlBackground(
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? GetSettings().GetStyleSettings().GetMenuColor()
+ : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+ maLineSpacing.SetColor(
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? GetSettings().GetStyleSettings().GetMenuColor()
+ : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+ maLineSpacing.SetBackground(
+ GetSettings().GetStyleSettings().GetHighContrastMode()
+ ? GetSettings().GetStyleSettings().GetMenuColor()
+ : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+
+ mpImg = new Image[4];
+ mpImg[0] = maSpacing1;
+ mpImg[1] = maSpacing115;
+ mpImg[2] = maSpacing15;
+ mpImg[3] = maSpacing2;
+
+ mpImgSel = new Image[4];
+ mpImgSel[0] = maSelSpacing1;
+ mpImgSel[1] = maSelSpacing115;
+ mpImgSel[2] = maSelSpacing15;
+ mpImgSel[3] = maSelSpacing2;
+
+ mpStr = new XubString[4];
+ mpStr[0] = XubString(SVX_RES(STR_SPACING1));
+ mpStr[1] = XubString(SVX_RES(STR_SPACING115));
+ mpStr[2] = XubString(SVX_RES(STR_SPACING15));
+ mpStr[3] = XubString(SVX_RES(STR_SPACING2));
+
+ mpStrTip = new XubString[4];
+ mpStrTip[0] = XubString(SVX_RES(STR_LS_SINGLE));
+ mpStrTip[1] = XubString(SVX_RES(STR_LS_115));
+ mpStrTip[2] = XubString(SVX_RES(STR_LS_15));
+ mpStrTip[3] = XubString(SVX_RES(STR_LS_DOUBLE));
+ for (int i=0;i<4;i++)
+ maLineSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
+
+ maLineSpacing.AddItem( maImgCus, 0, maStrCus, 0 );
+
+ SetAllNoSel();
+ Link aLink = LINK(this, ParaLineSpacingControl,VSSelHdl );
+ maLineSpacing.SetSelectHdl(aLink);
+ maLineSpacing.StartSelection();
+ maLineSpacing.Show();
+
+ aLink = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl );
+ aLineDist.SetSelectHdl(aLink);
+ aLineDist.SelectEntryPos( LLINESPACE_1 ) ;
+ aLink = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl );
+ aLineDistAtPercentBox.SetModifyHdl( aLink );
+ aLineDistAtMetricBox.SetModifyHdl( aLink );
}
+
void ParaLineSpacingControl::PopupModeEndCallback()
{
if( mbUseLineSPCustom )
@@ -405,6 +392,8 @@ void ParaLineSpacingControl::Rearrange(S
mbUseLineSPCustom = USE_CUSTOM;
}
break;
+ default:
+ break;
}
}
break;
@@ -460,6 +449,8 @@ void ParaLineSpacingControl::Rearrange(S
mbUseLineSPCustom = USE_CUSTOM;
}
break;
+ default:
+ break;
}
}
else if( eState == SFX_ITEM_DISABLED )
@@ -484,61 +475,38 @@ void ParaLineSpacingControl::Rearrange(S
aLineDist.SaveValue();
- /*sal_uInt16 nID = pBox->GetCurItemId();
- pBox->SetItemDown(nID, sal_True);
-
- Size aFloatSz = GetOutputSizePixel();
-
- GetLineSPFloatWin()->SetSizePixel( aFloatSz );
-
- Point aPos=maLineSPTbx->GetPosPixel();
- aPos.setX(aPos.getX());
- aPos = OutputToScreenPixel( aPos );
- Size aSize = maLineSPTbx->GetSizePixel();
- Rectangle aRect( aPos, aSize );
-
- GetLineSPFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_NOFOCUSCLOSE);
- GetLineSPFloatWin()->SetPopupModeFlags(GetLineSPFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
-
- pLineSPPage->ToGetFocus(bValueSetFocus);
- */
- sal_uInt16 uCount = aLineDist.GetEntryCount();
- if( uCount == LLINESPACE_FIX + 1 )
- {
- switch (currentContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_Table):
- case CombinedEnumContext(Application_Writer, Context_DrawText):
- case CombinedEnumContext(Application_Calc, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Writer, Context_Annotation):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
- {
- aLineDist.RemoveEntry(LLINESPACE_FIX);
- }
- }
- }
- else if( uCount == LLINESPACE_FIX)
- {
- switch (currentContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Writer, Context_Default):
- case CombinedEnumContext(Application_Writer, Context_Text):
- case CombinedEnumContext(Application_Writer, Context_Table):
- {
- aLineDist.InsertEntry(String::CreateFromAscii("Fixed"), LLINESPACE_FIX);
- }
- }
- }
- maLineSpacing.Format();
- maLineSpacing.StartSelection();
+ const sal_uInt16 uCount = aLineDist.GetEntryCount();
+ if( uCount == LLINESPACE_FIX + 1 )
+ {
+ switch (currentContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+ case CombinedEnumContext(Application_Calc, Context_DrawText):
+ case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
+ case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
+ {
+ aLineDist.RemoveEntry(LLINESPACE_FIX);
+ }
+ }
+ }
+ else if( uCount == LLINESPACE_FIX)
+ {
+ switch (currentContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_WriterVariants, Context_Default):
+ case CombinedEnumContext(Application_WriterVariants, Context_Text):
+ case CombinedEnumContext(Application_WriterVariants, Context_Table):
+ {
+ aLineDist.InsertEntry(String::CreateFromAscii("Fixed"), LLINESPACE_FIX);
+ }
+ }
+ }
+ maLineSpacing.Format();
+ maLineSpacing.StartSelection();
}
void ParaLineSpacingControl::SetAllNoSel()
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx Fri May 31 13:55:58 2013
@@ -43,7 +43,6 @@ class ParaLineSpacingControl:public svx:
public:
ParaLineSpacingControl(Window* pParent, svx::sidebar::ParaPropertyPanel& rPanel);
~ParaLineSpacingControl();
- void ToGetFocus(bool bType);
void Rearrange(SfxItemState currSPState,FieldUnit currMetricUnit,SvxLineSpacingItem* currSPItem,const ::sfx2::sidebar::EnumContext currentContext);
//virtual void Paint(const Rectangle& rect);
@@ -84,7 +83,6 @@ private:
Image maSpacing115;
Image maSpacing15;
Image maSpacing2;
- Image maLPCustom;
Image maSelSpacing1;
Image maSelSpacing115;
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx Fri May 31 13:55:58 2013
@@ -416,6 +416,10 @@ void ParaPropertyPanel::InitToolBoxInden
maRightIndent->SetModifyHdl( aLink );
maFLineIndent->SetModifyHdl( aLink );
+ maLeftIndent->SetAccessibleName(maLeftIndent->GetQuickHelpText());
+ maRightIndent->SetAccessibleName(maRightIndent->GetQuickHelpText());
+ maFLineIndent->SetAccessibleName(maFLineIndent->GetQuickHelpText());
+
const bool bIsHighContrastModeActive (Theme::IsHighContrastMode());
if( Application::GetSettings().GetLayoutRTL())
@@ -484,6 +488,9 @@ void ParaPropertyPanel::InitToolBoxSpaci
maTopDist->SetModifyHdl(aLink);
maBottomDist->SetModifyHdl( aLink );
+ maTopDist->SetAccessibleName(maTopDist->GetQuickHelpText());
+ maBottomDist->SetAccessibleName(maBottomDist->GetQuickHelpText());
+
maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM1, maParInc);
maTbxUL_IncDec->SetItemImage(TOOLBOX_ITEM2, maParDec);
aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl );
@@ -835,86 +842,86 @@ IMPL_LINK( ParaPropertyPanel, ModifyInde
IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl)
{
- switch (pControl->GetCurItemId())
- {
- case INDENT_INCREMENT:
- {
- switch (maContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Writer, Context_Default):
- case CombinedEnumContext(Application_Writer, Context_Text):
- case CombinedEnumContext(Application_Writer, Context_Table):
- {
- SfxBoolItem aMargin( SID_INC_INDENT, sal_True );
- GetBindings()->GetDispatcher()->Execute(
- SID_INC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L);
- }
- break;
- default:
- {
- SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
-
- maTxtLeft += INDENT_STEP;
- sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
- nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
- aMargin.SetTxtLeft( (const long)nVal );
- aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
- aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
-
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
- }
- }
- }
- break;
- case INDENT_DECREMENT:
- {
- switch (maContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Writer, Context_Default):
- case CombinedEnumContext(Application_Writer, Context_Text):
- case CombinedEnumContext(Application_Writer, Context_Table):
- {
- SfxBoolItem aMargin( SID_DEC_INDENT, sal_True );
- GetBindings()->GetDispatcher()->Execute(
- SID_DEC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L);
- }
- break;
- default:
- {
- if((maTxtLeft - INDENT_STEP) < 0)
- maTxtLeft = DEFAULT_VALUE;
- else
- maTxtLeft -= INDENT_STEP;
-
- SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
-
- sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
- nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
-
- aMargin.SetTxtLeft( (const long)nVal );
- aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
- aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
-
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
- }
- }
- }
- break;
- case ID_HANGING_INDENT:
- {
- SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
- aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
- aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
- aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ))*(-1) );
+ switch (pControl->GetCurItemId())
+ {
+ case INDENT_INCREMENT:
+ {
+ switch (maContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_WriterVariants, Context_Default):
+ case CombinedEnumContext(Application_WriterVariants, Context_Text):
+ case CombinedEnumContext(Application_WriterVariants, Context_Table):
+ {
+ SfxBoolItem aMargin( SID_INC_INDENT, sal_True );
+ GetBindings()->GetDispatcher()->Execute(
+ SID_INC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L);
+ }
+ break;
+ default:
+ {
+ SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
+
+ maTxtLeft += INDENT_STEP;
+ sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+ nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+ aMargin.SetTxtLeft( (const long)nVal );
+ aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+ aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+ }
+ }
+ }
+ break;
+ case INDENT_DECREMENT:
+ {
+ switch (maContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_WriterVariants, Context_Default):
+ case CombinedEnumContext(Application_WriterVariants, Context_Text):
+ case CombinedEnumContext(Application_WriterVariants, Context_Table):
+ {
+ SfxBoolItem aMargin( SID_DEC_INDENT, sal_True );
+ GetBindings()->GetDispatcher()->Execute(
+ SID_DEC_INDENT, SFX_CALLMODE_RECORD, &aMargin, 0L);
+ }
+ break;
+ default:
+ {
+ if((maTxtLeft - INDENT_STEP) < 0)
+ maTxtLeft = DEFAULT_VALUE;
+ else
+ maTxtLeft -= INDENT_STEP;
+
+ SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
+
+ sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+ nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
+
+ aMargin.SetTxtLeft( (const long)nVal );
+ aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+ aMargin.SetTxtFirstLineOfst( (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+ }
+ }
+ }
+ break;
+ case ID_HANGING_INDENT:
+ {
+ SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
+ aMargin.SetTxtLeft( (const long)GetCoreValue( *maLeftIndent.get(), m_eLRSpaceUnit ) + (const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ) );
+ aMargin.SetRight( (const long)GetCoreValue( *maRightIndent.get(), m_eLRSpaceUnit ) );
+ aMargin.SetTxtFirstLineOfst( ((const short)GetCoreValue( *maFLineIndent.get(), m_eLRSpaceUnit ))*(-1) );
- GetBindings()->GetDispatcher()->Execute(
- SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
- }
- break;
- }
- return( 0L );
+ GetBindings()->GetDispatcher()->Execute(
+ SID_ATTR_PARA_LRSPACE, SFX_CALLMODE_RECORD, &aMargin, 0L);
+ }
+ break;
+ }
+ return( 0L );
}
IMPL_LINK(ParaPropertyPanel, ClickProDemote_Hdl_Impl, ToolBox *, pControl)
@@ -1034,54 +1041,73 @@ void ParaPropertyPanel::NotifyItemUpdate
const bool bIsEnabled)
{
(void)bIsEnabled;
-
- if( nSID == SID_ATTR_METRIC )
- {
- m_eMetricUnit = GetCurrentUnit(eState,pState);
- if( m_eMetricUnit!=m_last_eMetricUnit )
- {
- SetFieldUnit( *maLeftIndent.get(), m_eMetricUnit );
- SetFieldUnit( *maRightIndent.get(), m_eMetricUnit );
- SetFieldUnit( *maFLineIndent.get(), m_eMetricUnit );
- SetFieldUnit( *maTopDist.get(), m_eMetricUnit );
- SetFieldUnit( *maBottomDist.get(), m_eMetricUnit );
- }
- m_last_eMetricUnit = m_eMetricUnit;
- }
- if( nSID == SID_ATTR_PARA_LRSPACE )
- StateChangedIndentImpl( nSID, eState, pState );
+ switch (nSID)
+ {
+ case SID_ATTR_METRIC:
+ {
+ m_eMetricUnit = GetCurrentUnit(eState,pState);
+ if( m_eMetricUnit!=m_last_eMetricUnit )
+ {
+ SetFieldUnit( *maLeftIndent.get(), m_eMetricUnit );
+ SetFieldUnit( *maRightIndent.get(), m_eMetricUnit );
+ SetFieldUnit( *maFLineIndent.get(), m_eMetricUnit );
+ SetFieldUnit( *maTopDist.get(), m_eMetricUnit );
+ SetFieldUnit( *maBottomDist.get(), m_eMetricUnit );
+ }
+ m_last_eMetricUnit = m_eMetricUnit;
+ }
+ break;
- if( nSID == SID_ATTR_PARA_LINESPACE )
- StateChangedLnSPImpl( nSID, eState, pState );
+ case SID_ATTR_PARA_LRSPACE:
+ StateChangedIndentImpl( nSID, eState, pState );
+ break;
- if( nSID == SID_ATTR_PARA_ULSPACE)
- StateChangedULImpl( nSID, eState, pState );
+ case SID_ATTR_PARA_LINESPACE:
+ StateChangedLnSPImpl( nSID, eState, pState );
+ break;
- if (nSID==SID_ATTR_PARA_ADJUST_LEFT || nSID==SID_ATTR_PARA_ADJUST_CENTER || nSID==SID_ATTR_PARA_ADJUST_RIGHT || nSID==SID_ATTR_PARA_ADJUST_BLOCK)
- StateChangedAlignmentImpl( nSID, eState, pState );
+ case SID_ATTR_PARA_ULSPACE:
+ StateChangedULImpl( nSID, eState, pState );
+ break;
- if (nSID==SID_OUTLINE_LEFT || nSID==SID_OUTLINE_RIGHT)
- StateChangeOutLineImpl( nSID, eState, pState );
+ case SID_ATTR_PARA_ADJUST_LEFT:
+ case SID_ATTR_PARA_ADJUST_CENTER:
+ case SID_ATTR_PARA_ADJUST_RIGHT:
+ case SID_ATTR_PARA_ADJUST_BLOCK:
+ StateChangedAlignmentImpl( nSID, eState, pState );
+ break;
- if (nSID==SID_INC_INDENT || nSID==SID_DEC_INDENT)
- StateChangeIncDecImpl( nSID, eState, pState );
- // Add toggle state for numbering and bullet icons
- if (nSID==FN_NUM_NUMBERING_ON || nSID==FN_NUM_BULLET_ON)
- StateChangeBulletNumImpl( nSID, eState, pState );
+ case SID_OUTLINE_LEFT:
+ case SID_OUTLINE_RIGHT:
+ StateChangeOutLineImpl( nSID, eState, pState );
+ break;
- //Get the num rule index data of the current selection
- if ( nSID == FN_BUL_NUM_RULE_INDEX ||nSID == FN_NUM_NUM_RULE_INDEX)
- StateChangeBulletNumRuleImpl( nSID, eState, pState );
-
- if ((nSID == SID_TABLE_VERT_NONE)||(nSID == SID_TABLE_VERT_CENTER)||(nSID == SID_TABLE_VERT_BOTTOM))
- {
- VertStateChanged( nSID, eState, pState);
- }
- else if (nSID == SID_BACKGROUND_COLOR)
- {
- ParaBKGStateChanged(nSID, eState, pState);
- }
+ case SID_INC_INDENT:
+ case SID_DEC_INDENT:
+ StateChangeIncDecImpl( nSID, eState, pState );
+ break;
+
+ case FN_NUM_NUMBERING_ON:
+ case FN_NUM_BULLET_ON:
+ StateChangeBulletNumImpl( nSID, eState, pState );
+ break;
+
+ case FN_BUL_NUM_RULE_INDEX:
+ case FN_NUM_NUM_RULE_INDEX:
+ StateChangeBulletNumRuleImpl( nSID, eState, pState );
+ break;
+
+ case SID_TABLE_VERT_NONE:
+ case SID_TABLE_VERT_CENTER:
+ case SID_TABLE_VERT_BOTTOM:
+ VertStateChanged( nSID, eState, pState);
+ break;
+
+ case SID_BACKGROUND_COLOR:
+ ParaBKGStateChanged(nSID, eState, pState);
+ break;
+ }
}
@@ -1174,160 +1200,146 @@ void ParaPropertyPanel::StateChangedAlig
void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState )
{
- switch (maContext.GetCombinedContext())
- {
-
- case CombinedEnumContext(Application_Writer, Context_DrawText):
- case CombinedEnumContext(Application_Calc, Context_DrawText):
- case CombinedEnumContext(Application_Writer, Context_Annotation):
- {
- maLeftIndent->SetMin( DEFAULT_VALUE );
- maRightIndent->SetMin( DEFAULT_VALUE );
- maFLineIndent->SetMin( DEFAULT_VALUE );
- maTbxIndent_IncDec->Show();
- maTbxProDemote->Hide();
- }
- break;
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_Table):
- {
- maLeftIndent->SetMin( DEFAULT_VALUE );
- maRightIndent->SetMin( DEFAULT_VALUE );
- maFLineIndent->SetMin( DEFAULT_VALUE );
- maTbxIndent_IncDec->Hide();
- maTbxProDemote->Show();
- }
- break;
- case CombinedEnumContext(Application_Writer, Context_Default):
- case CombinedEnumContext(Application_Writer, Context_Text):
- case CombinedEnumContext(Application_Writer, Context_Table):
- {
- maLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
- maRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
- maFLineIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
- maTbxIndent_IncDec->Show();
- maTbxProDemote->Hide();
- }
- break;
- }
+ switch (maContext.GetCombinedContext_DI())
+ {
- if( pState && eState >= SFX_ITEM_AVAILABLE )
- {
- SvxLRSpaceItem* pSpace = ( SvxLRSpaceItem*)pState;
- maTxtLeft = pSpace->GetTxtLeft();
- maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
- maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
-
- long aTxtRight = pSpace->GetRight();
- aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
- aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
-
- long aTxtFirstLineOfst = pSpace->GetTxtFirstLineOfst();
- aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
- aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
-
- long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
- nVal = (long)maLeftIndent->Normalize( (long)nVal );
- maLeftIndent->SetValue( nVal, FUNIT_100TH_MM );
-
- if(maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) &&
- maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
- maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table))
- {
- maFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM );
- }
+ case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
+ case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
+ case CombinedEnumContext(Application_Calc, Context_DrawText):
+ {
+ maLeftIndent->SetMin( DEFAULT_VALUE );
+ maRightIndent->SetMin( DEFAULT_VALUE );
+ maFLineIndent->SetMin( DEFAULT_VALUE );
+ maTbxIndent_IncDec->Show();
+ maTbxProDemote->Hide();
+ }
+ break;
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ {
+ maLeftIndent->SetMin( DEFAULT_VALUE );
+ maRightIndent->SetMin( DEFAULT_VALUE );
+ maFLineIndent->SetMin( DEFAULT_VALUE );
+ maTbxIndent_IncDec->Hide();
+ maTbxProDemote->Show();
+ }
+ break;
+ case CombinedEnumContext(Application_WriterVariants, Context_Default):
+ case CombinedEnumContext(Application_WriterVariants, Context_Text):
+ case CombinedEnumContext(Application_WriterVariants, Context_Table):
+ {
+ maLeftIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+ maRightIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+ maFLineIndent->SetMin( NEGA_MAXVALUE, FUNIT_100TH_MM );
+ maTbxIndent_IncDec->Show();
+ maTbxProDemote->Hide();
+ }
+ break;
+ }
- long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
- nrVal = (long)maRightIndent->Normalize( (long)nrVal );
- maRightIndent->SetValue( nrVal, FUNIT_100TH_MM );
-
- long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
- nfVal = (long)maFLineIndent->Normalize( (long)nfVal );
- maFLineIndent->SetValue( nfVal, FUNIT_100TH_MM );
+ if( pState && eState >= SFX_ITEM_AVAILABLE )
+ {
+ SvxLRSpaceItem* pSpace = ( SvxLRSpaceItem*)pState;
+ maTxtLeft = pSpace->GetTxtLeft();
+ maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
+ maTxtLeft = OutputDevice::LogicToLogic( maTxtLeft, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+ long aTxtRight = pSpace->GetRight();
+ aTxtRight = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
+ aTxtRight = OutputDevice::LogicToLogic( aTxtRight, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+ long aTxtFirstLineOfst = pSpace->GetTxtFirstLineOfst();
+ aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)m_eLRSpaceUnit, MAP_100TH_MM );
+ aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MAP_100TH_MM, (MapUnit)(SFX_MAPUNIT_TWIP) );
+
+ long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+ nVal = (long)maLeftIndent->Normalize( (long)nVal );
+ maLeftIndent->SetValue( nVal, FUNIT_100TH_MM );
+
+ if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text)
+ && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default)
+ && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table))
+ {
+ maFLineIndent->SetMin( nVal*(-1), FUNIT_100TH_MM );
+ }
- switch (maContext.GetCombinedContext())
- {
- case CombinedEnumContext(Application_Writer, Context_DrawText):
- case CombinedEnumContext(Application_Writer, Context_Text):
- case CombinedEnumContext(Application_Writer, Context_Default):
- case CombinedEnumContext(Application_Writer, Context_Table):
- case CombinedEnumContext(Application_Writer, Context_Annotation):
- {
- maLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM );
- maRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM );
- maFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM );
- }
- break;
- case CombinedEnumContext(Application_Draw, Context_DrawText):
- case CombinedEnumContext(Application_Draw, Context_Draw):
- case CombinedEnumContext(Application_Draw, Context_Table):
- case CombinedEnumContext(Application_Draw, Context_TextObject):
- case CombinedEnumContext(Application_Draw, Context_Graphic):
- case CombinedEnumContext(Application_Impress, Context_TextObject):
- case CombinedEnumContext(Application_Impress, Context_DrawText):
- case CombinedEnumContext(Application_Impress, Context_Table):
- case CombinedEnumContext(Application_Impress, Context_Draw):
- case CombinedEnumContext(Application_Impress, Context_Graphic):
- {
- maLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM );
- maRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM );
- maFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FUNIT_100TH_MM );
- }
- }
+ long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+ nrVal = (long)maRightIndent->Normalize( (long)nrVal );
+ maRightIndent->SetValue( nrVal, FUNIT_100TH_MM );
+
+ long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
+ nfVal = (long)maFLineIndent->Normalize( (long)nfVal );
+ maFLineIndent->SetValue( nfVal, FUNIT_100TH_MM );
+
+ switch (maContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
+ case CombinedEnumContext(Application_WriterVariants, Context_Text):
+ case CombinedEnumContext(Application_WriterVariants, Context_Default):
+ case CombinedEnumContext(Application_WriterVariants, Context_Table):
+ case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
+ {
+ maLeftIndent->SetMax( MAX_SW - nrVal, FUNIT_100TH_MM );
+ maRightIndent->SetMax( MAX_SW - nVal, FUNIT_100TH_MM );
+ maFLineIndent->SetMax( MAX_SW - nVal - nrVal, FUNIT_100TH_MM );
+ }
+ break;
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+ {
+ maLeftIndent->SetMax( MAX_SC_SD - nrVal, FUNIT_100TH_MM );
+ maRightIndent->SetMax( MAX_SC_SD - nVal, FUNIT_100TH_MM );
+ maFLineIndent->SetMax( MAX_SC_SD - nVal - nrVal, FUNIT_100TH_MM );
+ }
+ }
maTbxIndent_IncDec->Enable();
maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_True);
- if ( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text)
- && maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default)
- && maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table) )
+ if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text)
+ && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default)
+ && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) )
{
maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True);
maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True);
}
-// maTbxProDemote->Enable();
-// if( !mbOutLineRight && !mbOutLineLeft )
-// maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True);
- maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True);
- }
- else if( eState == SFX_ITEM_DISABLED )
- {
- maLeftIndent-> Disable();
- maRightIndent->Disable();
- maFLineIndent->Disable();
- maTbxIndent_IncDec->Disable();
- if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) &&
- maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
- maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table) )
- maTbxIndent_IncDec->Disable();
- else
- maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False);
+ maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_True);
+ }
+ else if( eState == SFX_ITEM_DISABLED )
+ {
+ maLeftIndent-> Disable();
+ maRightIndent->Disable();
+ maFLineIndent->Disable();
+ maTbxIndent_IncDec->Disable();
+ if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) &&
+ maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) &&
+ maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) )
+ maTbxIndent_IncDec->Disable();
+ else
+ maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False);
-// maTbxProDemote->Disable();
- maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
- }
- else
- {
- maLeftIndent->SetEmptyFieldValue();
- maRightIndent->SetEmptyFieldValue();
- maFLineIndent->SetEmptyFieldValue();
- if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) &&
- maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) &&
- maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table) )
- maTbxIndent_IncDec->Disable();
- else
- maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False);
-// maTbxProDemote->Disable();
- maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
- }
+ // maTbxProDemote->Disable();
+ maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
+ }
+ else
+ {
+ maLeftIndent->SetEmptyFieldValue();
+ maRightIndent->SetEmptyFieldValue();
+ maFLineIndent->SetEmptyFieldValue();
+ if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) &&
+ maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) &&
+ maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table) )
+ maTbxIndent_IncDec->Disable();
+ else
+ maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_False);
+ maTbxProDemote->EnableItem(SD_HANGING_INDENT, sal_False);
+ }
}
void ParaPropertyPanel::StateChangedLnSPImpl( sal_uInt16 /* nSID */, SfxItemState eState, const SfxPoolItem* pState )
@@ -1412,9 +1424,9 @@ void ParaPropertyPanel::StateChangeOutLi
void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
{
- if ( ( maContext.GetCombinedContext() == CombinedEnumContext(Application_Writer, Context_Text)
- || maContext.GetCombinedContext() == CombinedEnumContext(Application_Writer, Context_Default)
- || maContext.GetCombinedContext() == CombinedEnumContext(Application_Writer, Context_Table) )
+ if ( ( maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Text)
+ || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Default)
+ || maContext.GetCombinedContext_DI() == CombinedEnumContext(Application_WriterVariants, Context_Table) )
&& ( nSID == SID_INC_INDENT || nSID == SID_DEC_INDENT ) )
{
// Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT
@@ -1431,25 +1443,19 @@ void ParaPropertyPanel::StateChangeBulle
{
if ( (eState >= SFX_ITEM_DEFAULT) && (pState->ISA(SfxBoolItem)) )
{
+ const SfxBoolItem* pItem= (const SfxBoolItem*)pState;
+ const sal_Bool aBool = (sal_Bool)pItem->GetValue();
if (nSID==FN_NUM_NUMBERING_ON)
{
- const SfxBoolItem* pItem= (const SfxBoolItem*)pState;
- sal_Bool aBool = (sal_Bool)pItem->GetValue();
- if (aBool) {
- maTBxNumBullet->SetItemState(IID_NUMBER, STATE_CHECK);
- } else {
- maTBxNumBullet->SetItemState(IID_NUMBER, STATE_NOCHECK);
- }
+ maTBxNumBullet->SetItemState(
+ IID_NUMBER,
+ aBool ? STATE_CHECK : STATE_NOCHECK );
}
else if (nSID==FN_NUM_BULLET_ON)
{
- const SfxBoolItem* pItem= (const SfxBoolItem*)pState;
- sal_Bool aBool = (sal_Bool)pItem->GetValue();
- if (aBool) {
- maTBxNumBullet->SetItemState(IID_BULLET, STATE_CHECK);
- } else {
- maTBxNumBullet->SetItemState(IID_BULLET, STATE_NOCHECK);
- }
+ maTBxNumBullet->SetItemState(
+ IID_BULLET,
+ aBool ? STATE_CHECK : STATE_NOCHECK );
}
}
}
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/paragraph/ParaPropertyPanel.hrc Fri May 31 13:55:58 2013
@@ -119,7 +119,6 @@
#define IMG_SPACING115 19
#define IMG_SPACING15 20
#define IMG_SPACING2 21
-#define IMG_SPACINGLCUSTOM 22
#define IMG_SEL_SPACING1 23
#define IMG_SEL_SPACING115 24
#define IMG_SEL_SPACING15 25
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx Fri May 31 13:55:58 2013
@@ -1043,12 +1043,11 @@ void PosSizePropertyPanel::executeSize()
SfxUInt32Item aWidthItem( SID_ATTR_TRANSFORM_WIDTH, (sal_uInt32) lWidth);
SfxUInt32Item aHeightItem( SID_ATTR_TRANSFORM_HEIGHT, (sal_uInt32) lHeight);
SfxAllEnumItem aPointItem (SID_ATTR_TRANSFORM_SIZE_POINT, (sal_uInt16)meRP);
- const sal_Int32 nCombinedContext(maContext.GetCombinedContext());
+ const sal_Int32 nCombinedContext(maContext.GetCombinedContext_DI());
- if( nCombinedContext == CombinedEnumContext(Application_Writer, Context_Graphic) // mnContextId == PROPERTY_CONTEXT_SW_GRAPHIC
- || nCombinedContext == CombinedEnumContext(Application_Writer, Context_OLE) //mnContextId == PROPERTY_CONTEXT_SW_OLE
+ if( nCombinedContext == CombinedEnumContext(Application_WriterVariants, Context_Graphic)
+ || nCombinedContext == CombinedEnumContext(Application_WriterVariants, Context_OLE)
)
- // if( mnContextId == PROPERTY_CONTEXT_SW_GRAPHIC || mnContextId == PROPERTY_CONTEXT_SW_OLE )
{
GetBindings()->GetDispatcher()->Execute(SID_ATTR_TRANSFORM, SFX_CALLMODE_RECORD, &aWidthItem, &aHeightItem, &aPointItem, 0L );
}
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.cxx?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.cxx (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.cxx Fri May 31 13:55:58 2013
@@ -44,7 +44,9 @@
#include <sfx2/viewsh.hxx>
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <sfx2/sidebar/ControlFactory.hxx>
+#include <sfx2/sidebar/ControllerFactory.hxx>
#include <sfx2/sidebar/Theme.hxx>
+#include <sfx2/sidebar/SidebarToolBox.hxx>
#include "sfx2/imagemgr.hxx"
#include <svtools/ctrltool.hxx>
#include <svtools/unitconv.hxx>
@@ -73,17 +75,8 @@ namespace svx { namespace sidebar {
#undef HAS_IA2
-#define FONT_CONTROL_WIDTH 160
-#define SIZE_CONTROL_WIDTH 80
-#define CONTROL_COMBOX_HEIGHT 20
-#define CONTROL_HEIGHT_5X 120
-
-#define TEXT_SECTIONPAGE_HEIGHT_S SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) + CONTROL_SPACING_VERTICAL * 1 + SECTIONPAGE_MARGIN_VERTICAL_BOT
-#define TEXT_SECTIONPAGE_HEIGHT SECTIONPAGE_MARGIN_VERTICAL_TOP + CBOX_HEIGHT + ( TOOLBOX_ITEM_HEIGHT + 2 ) * 2 + CONTROL_SPACING_VERTICAL * 2 + SECTIONPAGE_MARGIN_VERTICAL_BOT
-
-
- PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
+PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
{
return new TextCharacterSpacingControl(pParent, *this, mpBindings);
}
@@ -101,36 +94,6 @@ namespace
}
} // end of anonymous namespace
-PopupControl* TextPropertyPanel::CreateFontColorPopupControl (PopupContainer* pParent)
-{
- const ResId aResId(SVX_RES(STR_AUTOMATICE));
-
- return new ColorControl(
- pParent,
- mpBindings,
- SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
- SVX_RES(VS_FONT_COLOR),
- ::boost::bind(GetAutomaticColor),
- ::boost::bind(&TextPropertyPanel::SetFontColor, this, _1,_2),
- pParent,
- &aResId);
-}
-
-PopupControl* TextPropertyPanel::CreateBrushColorPopupControl (PopupContainer* pParent)
-{
- const ResId aResId(SVX_RES(STR_AUTOMATICE));
-
- return new ColorControl(
- pParent,
- mpBindings,
- SVX_RES(RID_POPUPPANEL_TEXTPAGE_FONT_COLOR),
- SVX_RES(VS_FONT_COLOR),
- ::boost::bind(GetAutomaticColor),
- ::boost::bind(&TextPropertyPanel::SetBrushColor, this, _1,_2),
- pParent,
- &aResId);
-}
-
long TextPropertyPanel::GetSelFontSize()
{
long nH = 240;
@@ -144,7 +107,8 @@ long TextPropertyPanel::GetSelFontSize()
TextPropertyPanel* TextPropertyPanel::Create (
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ SfxBindings* pBindings,
+ const ::sfx2::sidebar::EnumContext& rContext)
{
if (pParent == NULL)
throw lang::IllegalArgumentException(A2S("no parent Window given to TextPropertyPanel::Create"), NULL, 0);
@@ -156,7 +120,8 @@ TextPropertyPanel* TextPropertyPanel::Cr
return new TextPropertyPanel(
pParent,
rxFrame,
- pBindings);
+ pBindings,
+ rContext);
}
@@ -168,7 +133,8 @@ TextPropertyPanel* TextPropertyPanel::Cr
TextPropertyPanel::TextPropertyPanel (
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+ SfxBindings* pBindings,
+ const ::sfx2::sidebar::EnumContext& rContext)
: Control(pParent, SVX_RES(RID_SIDEBAR_TEXT_PANEL)),
mpFontNameBox (new SvxSBFontNameBox(this, SVX_RES(CB_SBFONT_FONT))),
maFontSizeBox (this, SVX_RES(MB_SBFONT_FONTSIZE)),
@@ -195,11 +161,18 @@ TextPropertyPanel::TextPropertyPanel (
mpToolBoxFontColorBackground(ControlFactory::CreateToolBoxBackground(this)),
mpToolBoxFontColor(ControlFactory::CreateToolBox(
mpToolBoxFontColorBackground.get(),
- SVX_RES(TB_FONTCOLOR))),
+ SVX_RES(TB_FONTCOLOR),
+ rxFrame)),
+ mpToolBoxFontColorBackgroundSW(ControlFactory::CreateToolBoxBackground(this)),
+ mpToolBoxFontColorSW(ControlFactory::CreateToolBox(
+ mpToolBoxFontColorBackgroundSW.get(),
+ SVX_RES(TB_FONTCOLOR_SW),
+ rxFrame)),
mpToolBoxHighlightBackground(ControlFactory::CreateToolBoxBackground(this)),
mpToolBoxHighlight(ControlFactory::CreateToolBox(
mpToolBoxHighlightBackground.get(),
- SVX_RES(TB_HIGHLIGHT))),
+ SVX_RES(TB_HIGHLIGHT),
+ rxFrame)),
mpFontColorUpdater(),
mpHighlightUpdater(),
@@ -210,12 +183,10 @@ TextPropertyPanel::TextPropertyPanel (
maUnderlineControl (SID_ATTR_CHAR_UNDERLINE, *pBindings, *this, A2S("Underline"), rxFrame),
maStrikeControl (SID_ATTR_CHAR_STRIKEOUT, *pBindings, *this, A2S("Strikeout"), rxFrame),
maShadowControl (SID_ATTR_CHAR_SHADOWED, *pBindings, *this, A2S("Shadowed"), rxFrame),
- maFontColorControl (SID_ATTR_CHAR_COLOR, *pBindings, *this, A2S("Color"), rxFrame),
maScriptControlSw (SID_ATTR_CHAR_ESCAPEMENT, *pBindings, *this, A2S("Escapement"), rxFrame),
maSuperScriptControl(SID_SET_SUPER_SCRIPT, *pBindings, *this, A2S("SuperScript"), rxFrame),
maSubScriptControl (SID_SET_SUB_SCRIPT, *pBindings, *this, A2S("SubScript"), rxFrame),
maSpacingControl (SID_ATTR_CHAR_KERNING, *pBindings, *this, A2S("Spacing"), rxFrame),
- maHighlightControl (SID_ATTR_BRUSH_CHAR, *pBindings, *this, A2S("CharacterBackgroundPattern"),rxFrame),
maSDFontGrow (SID_GROW_FONT_SIZE, *pBindings, *this, A2S("Grow"), rxFrame),
maSDFontShrink (SID_SHRINK_FONT_SIZE, *pBindings, *this, A2S("Shrink"), rxFrame),
@@ -224,14 +195,15 @@ TextPropertyPanel::TextPropertyPanel (
mbFocusOnFontSizeCtrl(false),
maCharSpacePopup(this, ::boost::bind(&TextPropertyPanel::CreateCharacterSpacingControl, this, _1)),
maUnderlinePopup(this, ::boost::bind(&TextPropertyPanel::CreateUnderlinePopupControl, this, _1)),
- maFontColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateFontColorPopupControl, this, _1)),
- maBrushColorPopup(this, ::boost::bind(&TextPropertyPanel::CreateBrushColorPopupControl, this, _1)),
mxFrame(rxFrame),
maContext(),
mpBindings(pBindings)
{
Initialize();
+
FreeResource();
+
+ UpdateFontColorToolbox(rContext);
}
@@ -246,6 +218,7 @@ TextPropertyPanel::~TextPropertyPanel (v
mpToolBoxIncDec.reset();
mpToolBoxFont.reset();
mpToolBoxFontColor.reset();
+ mpToolBoxFontColorSW.reset();
mpToolBoxScript.reset();
mpToolBoxScriptSw.reset();
mpToolBoxSpacing.reset();
@@ -255,6 +228,7 @@ TextPropertyPanel::~TextPropertyPanel (v
mpToolBoxIncDecBackground.reset();
mpToolBoxFontBackground.reset();
mpToolBoxFontColorBackground.reset();
+ mpToolBoxFontColorBackgroundSW.reset();
mpToolBoxScriptBackground.reset();
mpToolBoxScriptSwBackground.reset();
mpToolBoxSpacingBackground.reset();
@@ -330,6 +304,30 @@ void TextPropertyPanel::HandleContextCha
default:
break;
}
+
+ UpdateFontColorToolbox(aContext);
+}
+
+
+
+
+void TextPropertyPanel::UpdateFontColorToolbox (
+ const ::sfx2::sidebar::EnumContext /* aContext */)
+{
+ bool bIsWriterFontColor (false);
+ if (maContext.GetApplication_DI() == sfx2::sidebar::EnumContext::Application_WriterVariants)
+ if (maContext.GetContext() != sfx2::sidebar::EnumContext::Context_DrawText)
+ bIsWriterFontColor = true;
+ if (bIsWriterFontColor)
+ {
+ mpToolBoxFontColor->Hide();
+ mpToolBoxFontColorSW->Show();
+ }
+ else
+ {
+ mpToolBoxFontColor->Show();
+ mpToolBoxFontColorSW->Hide();
+ }
}
@@ -344,6 +342,7 @@ void TextPropertyPanel::DataChanged (con
+
void TextPropertyPanel::Initialize (void)
{
//<<modify fill font list
@@ -369,10 +368,8 @@ void TextPropertyPanel::Initialize (void
SetupToolboxItems();
InitToolBoxIncDec();
InitToolBoxFont();
- InitToolBoxFontColor();
InitToolBoxScript();
InitToolBoxSpacing();
- InitToolBoxHighlight();
#ifdef HAS_IA2
mpFontNameBox->SetAccRelationLabeledBy(&mpFontNameBox);
@@ -397,28 +394,14 @@ void TextPropertyPanel::Initialize (void
mbPostureAvailable = true;
mbWeightAvailable = true;
meUnderline = UNDERLINE_NONE;
- meUnderlineColor = COL_AUTO; //
- maColor = COL_BLACK;
- mbColorAvailable = true;
- maBackColor = COL_AUTO;
- mbBackColorAvailable = true;
+ meUnderlineColor = COL_AUTO;
meEscape = SVX_ESCAPEMENT_OFF;
mbSuper = false;
mbSub = false;
mbKernAvailable = true;
mbKernLBAvailable = true;
mlKerning = 0;
- mpFontColorUpdater.reset(new ToolboxButtonColorUpdater(
- SID_ATTR_CHAR_COLOR,
- TBI_FONTCOLOR,
- mpToolBoxFontColor.get(),
- TBX_UPDATER_MODE_CHAR_COLOR_NEW));
- mpHighlightUpdater.reset(new ToolboxButtonColorUpdater(
- SID_ATTR_BRUSH_CHAR,
- TBI_HIGHLIGHT,
- mpToolBoxHighlight.get(),
- TBX_UPDATER_MODE_CHAR_COLOR_NEW));
-
+
//set handler
mpFontNameBox->SetBindings(mpBindings);
Link aLink = LINK(this, TextPropertyPanel, FontSelHdl);
@@ -429,11 +412,6 @@ void TextPropertyPanel::Initialize (void
maFontSizeBox.SetSelectHdl(aLink);
aLink = LINK(this, TextPropertyPanel, FontSizeLoseFocus);
maFontSizeBox.SetLoseFocusHdl(aLink);
-
- Size aSize(PROPERTYPAGE_WIDTH, TEXT_SECTIONPAGE_HEIGHT);
- aSize = LogicToPixel( aSize, MapMode(MAP_APPFONT) );
- aSize.setWidth(GetOutputSizePixel().Width());
- SetSizePixel(aSize);
}
void TextPropertyPanel::EndSpacingPopupMode (void)
@@ -476,17 +454,6 @@ void TextPropertyPanel::InitToolBoxIncDe
-void TextPropertyPanel::InitToolBoxFontColor()
-{
- Size aTbxSize( mpToolBoxFontColor->CalcWindowSizePixel() );
- mpToolBoxFontColor->SetOutputSizePixel( aTbxSize );
- mpToolBoxFontColor->SetItemBits( TBI_FONTCOLOR, mpToolBoxFontColor->GetItemBits( TBI_FONTCOLOR ) | TIB_DROPDOWNONLY );
-
- Link aLink = LINK(this, TextPropertyPanel, ToolBoxFontColorDropHdl);
- mpToolBoxFontColor->SetDropdownClickHdl ( aLink );
- mpToolBoxFontColor->SetSelectHdl ( aLink );
-
-}
void TextPropertyPanel::InitToolBoxScript()
{
Size aTbxSize( mpToolBoxScriptSw->CalcWindowSizePixel() );
@@ -511,16 +478,6 @@ void TextPropertyPanel::InitToolBoxSpaci
mpToolBoxSpacing->SetDropdownClickHdl ( aLink );
mpToolBoxSpacing->SetSelectHdl( aLink );
}
-void TextPropertyPanel::InitToolBoxHighlight()
-{
- Size aTbxSize( mpToolBoxHighlight->CalcWindowSizePixel() );
- mpToolBoxHighlight->SetOutputSizePixel( aTbxSize );
- mpToolBoxHighlight->SetItemBits( TBI_HIGHLIGHT, mpToolBoxHighlight->GetItemBits( TBI_HIGHLIGHT ) | TIB_DROPDOWNONLY );
-
- Link aLink = LINK(this, TextPropertyPanel, ToolBoxHighlightDropHdl);
- mpToolBoxHighlight->SetDropdownClickHdl ( aLink );
- mpToolBoxHighlight->SetSelectHdl( aLink );
-}
@@ -536,7 +493,6 @@ void TextPropertyPanel::SetupToolboxItem
maStrikeControl.SetupToolBoxItem(*mpToolBoxFont, TBI_STRIKEOUT);
maShadowControl.SetupToolBoxItem(*mpToolBoxFont, TBI_SHADOWED);
- maFontColorControl.SetupToolBoxItem(*mpToolBoxFontColor, TBI_FONTCOLOR);
//for sw
maSuperScriptControl.SetupToolBoxItem(*mpToolBoxScriptSw, TBI_SUPER_SW);
maSubScriptControl.SetupToolBoxItem(*mpToolBoxScriptSw, TBI_SUB_SW);
@@ -544,7 +500,6 @@ void TextPropertyPanel::SetupToolboxItem
maSuperScriptControl.SetupToolBoxItem(*mpToolBoxScript, TBI_SUPER);
maSubScriptControl.SetupToolBoxItem(*mpToolBoxScript, TBI_SUB);
maSpacingControl.SetupToolBoxItem(*mpToolBoxSpacing, TBI_SPACING);
- maHighlightControl.SetupToolBoxItem(*mpToolBoxHighlight, TBI_HIGHLIGHT);
}
@@ -808,22 +763,6 @@ IMPL_LINK(TextPropertyPanel, ToolBoxUnde
-IMPL_LINK(TextPropertyPanel, ToolBoxFontColorDropHdl,ToolBox*, pToolBox)
-{
- const sal_uInt16 nId = pToolBox->GetCurItemId();
- if(nId == TBI_FONTCOLOR)
- {
- pToolBox->SetItemDown( nId, true );
-
- maFontColorPopup.Show(*pToolBox);
- maFontColorPopup.SetCurrentColor(maColor, mbColorAvailable);
- }
- return 0;
-}
-
-
-
-
IMPL_LINK(TextPropertyPanel, ToolBoxSwScriptSelectHdl, ToolBox*, pToolBox)
{
const sal_uInt16 nId = pToolBox->GetCurItemId();
@@ -889,21 +828,6 @@ IMPL_LINK(TextPropertyPanel, ToolBoxScri
-IMPL_LINK(TextPropertyPanel, ToolBoxHighlightDropHdl, ToolBox*, pToolBox)
-{
- const sal_uInt16 nId = pToolBox->GetCurItemId();
- if(nId == TBI_HIGHLIGHT)
- {
- pToolBox->SetItemDown( nId, true );
- maBrushColorPopup.Show(*pToolBox);
- maBrushColorPopup.SetCurrentColor(maBackColor, mbBackColorAvailable);
-
- }
- return 0;
-}
-
-
-
IMPL_LINK(TextPropertyPanel, SpacingClickHdl, ToolBox*, pToolBox)
{
const sal_uInt16 nId = pToolBox->GetCurItemId();
@@ -953,16 +877,38 @@ void TextPropertyPanel::NotifyItemUpdate
{
mpHeightItem = (SvxFontHeightItem*)pState;//const SvxFontHeightItem*
SfxMapUnit eUnit = maFontSizeControl.GetCoreMetric();
- long iValue = (long)CalcToPoint( mpHeightItem->GetHeight(), eUnit, 10 );
+ const sal_Int64 nValue (CalcToPoint(mpHeightItem->GetHeight(), eUnit, 10 ));
mpToolBoxIncDec->Enable();
mpToolBoxIncDec->SetItemState(TBI_INCREASE, STATE_NOCHECK);
mpToolBoxIncDec->SetItemState(TBI_DECREASE, STATE_NOCHECK);
+ // For Writer we have to update the states of the
+ // increase and decrease buttons here, because we have
+ // no access to the slots used by Writer.
+ switch(maContext.GetCombinedContext_DI())
+ {
+ case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Text):
+ case CombinedEnumContext(Application_DrawImpress, Context_Table):
+ case CombinedEnumContext(Application_DrawImpress, Context_OutlineText):
+ case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+ case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+ case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+ break;
+
+ default:
+ {
+ mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nValue<960);
+ mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nValue>60);
+ break;
+ }
+ }
+
if( mbFocusOnFontSizeCtrl )
return;
- maFontSizeBox.SetValue( iValue );
+ maFontSizeBox.SetValue(nValue);
maFontSizeBox.LoseFocus();
UpdateItem(SID_SHRINK_FONT_SIZE);
@@ -1075,44 +1021,6 @@ void TextPropertyPanel::NotifyItemUpdate
: STATE_NOCHECK);
break;
- case SID_ATTR_CHAR_COLOR:
- if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxColorItem))
- {
- const SvxColorItem* pItem = (const SvxColorItem*)pState;
- maColor = pItem->GetValue();
- mbColorAvailable = true;
- if (mpFontColorUpdater)
- mpFontColorUpdater->Update(maColor);
- }
- else
- {
- mbColorAvailable = false;
- maColor.SetColor(COL_AUTO);
- if (mpFontColorUpdater)
- mpFontColorUpdater->Update(maColor);
- }
- mpToolBoxFontColor->EnableItem(TBI_FONTCOLOR, bIsEnabled);
- break;
-
- case SID_ATTR_BRUSH_CHAR:
- if( eState >= SFX_ITEM_DEFAULT && pState->ISA(SvxBrushItem))
- {
- const SvxBrushItem* pItem = (const SvxBrushItem*)pState;
- maBackColor = pItem->GetColor();
- mbBackColorAvailable = true;
- if (mpHighlightUpdater)
- mpHighlightUpdater->Update(maBackColor);
- }
- else
- {
- mbBackColorAvailable = false;
- maBackColor.SetColor(COL_AUTO);
- if (mpHighlightUpdater)
- mpHighlightUpdater->Update(maBackColor);
- }
- mpToolBoxHighlight->EnableItem(TBI_HIGHLIGHT, bIsEnabled);
- break;
-
case SID_ATTR_CHAR_ESCAPEMENT:
{
bool bIsItemEnabled (true);
@@ -1132,7 +1040,7 @@ void TextPropertyPanel::NotifyItemUpdate
{
meEscape = SVX_ESCAPEMENT_SUPERSCRIPT;
mpToolBoxScriptSw->SetItemState(TBI_SUPER_SW, STATE_CHECK);
- mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
+ mpToolBoxScriptSw->SetItemState(TBI_SUB_SW, STATE_NOCHECK);
}
else
{
@@ -1156,8 +1064,8 @@ void TextPropertyPanel::NotifyItemUpdate
{
meEscape = SVX_ESCAPEMENT_OFF;
}
- mpToolBoxScriptSw->EnableItem(TBI_SUPER, bIsItemEnabled && bIsEnabled);
- mpToolBoxScriptSw->EnableItem(TBI_SUB, bIsItemEnabled && bIsEnabled);
+ mpToolBoxScriptSw->EnableItem(TBI_SUPER_SW, bIsItemEnabled && bIsEnabled);
+ mpToolBoxScriptSw->EnableItem(TBI_SUB_SW, bIsItemEnabled && bIsEnabled);
break;
}
@@ -1233,17 +1141,27 @@ void TextPropertyPanel::NotifyItemUpdate
case CombinedEnumContext(Application_DrawImpress, Context_Draw):
case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+ {
if(eState == SFX_ITEM_DISABLED)
mpToolBoxIncDec->Disable();
else
mpToolBoxIncDec->Enable();
- break;
+ const sal_Int64 nSize (maFontSizeBox.GetValue());
+ switch(nSID)
+ {
+ case SID_GROW_FONT_SIZE:
+ mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
+ break;
+
+ case SID_SHRINK_FONT_SIZE:
+ mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
+ break;
+
+ default:
+ break;
+ }
+ }
}
- const sal_Int32 nSize (maFontSizeBox.GetValue());
- if (nSID == SID_GROW_FONT_SIZE)
- mpToolBoxIncDec->EnableItem(TBI_INCREASE, bIsEnabled && nSize<960);
- else
- mpToolBoxIncDec->EnableItem(TBI_DECREASE, bIsEnabled && nSize>60);
break;
}
}
@@ -1276,9 +1194,6 @@ void TextPropertyPanel::UpdateItem (cons
case SID_ATTR_CHAR_SHADOWED:
maShadowControl.RequestUpdate();
break;
- case SID_ATTR_CHAR_COLOR:
- maFontColorControl.RequestUpdate();
- break;
case SID_ATTR_CHAR_ESCAPEMENT:
maScriptControlSw.RequestUpdate();
break;
@@ -1291,9 +1206,6 @@ void TextPropertyPanel::UpdateItem (cons
case SID_ATTR_CHAR_KERNING:
maSpacingControl.RequestUpdate();
break;
- case SID_ATTR_BRUSH_CHAR:
- maHighlightControl.RequestUpdate();
- break;
case SID_GROW_FONT_SIZE:
maSDFontGrow.RequestUpdate();
break;
@@ -1307,24 +1219,6 @@ void TextPropertyPanel::UpdateItem (cons
-void TextPropertyPanel::SetFontColor (
- const String& /* rsColorName */,
- const Color aColor)
-{
- SvxColorItem aColorItem(aColor, SID_ATTR_CHAR_COLOR);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_COLOR, SFX_CALLMODE_RECORD, &aColorItem, 0L);
- maColor = aColor;
-}
-
-void TextPropertyPanel::SetBrushColor (
- const String& /* rsColorName */,
- const Color aColor)
-{
- SvxBrushItem aBrushItem(aColor, SID_ATTR_BRUSH_CHAR);
- mpBindings->GetDispatcher()->Execute(SID_ATTR_BRUSH_CHAR, SFX_CALLMODE_RECORD, &aBrushItem, 0L);
- maBackColor = aColor;
-}
-
Color& TextPropertyPanel::GetUnderlineColor()
{
return meUnderlineColor;
Modified: openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.hrc?rev=1488227&r1=1488226&r2=1488227&view=diff
==============================================================================
--- openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.hrc (original)
+++ openoffice/branches/rejuvenate01/main/svx/source/sidebar/text/TextPropertyPanel.hrc Fri May 31 13:55:58 2013
@@ -34,11 +34,11 @@
#define TB_FONT 4
#define TB_INCREASE_DECREASE 5
#define TB_FONTCOLOR 6
-#define TB_SCRIPT_SW 7
+#define TB_FONTCOLOR_SW 7
#define TB_HIGHLIGHT 8
#define TB_SPACING 9
#define TB_SCRIPT 10
-
+#define TB_SCRIPT_SW 11
#define TBI_FONTCOLOR 50
#define TBI_BOLD 51