Cleanup
diff --git a/main/sfx2/source/sidebar/Context.cxx b/main/sfx2/source/sidebar/Context.cxx
index e2e02de..0cf7fe0 100644
--- a/main/sfx2/source/sidebar/Context.cxx
+++ b/main/sfx2/source/sidebar/Context.cxx
@@ -31,92 +31,78 @@
const sal_Int32 Context::NoMatch = 4;
const sal_Int32 Context::ApplicationWildcardMatch = 1;
const sal_Int32 Context::ContextWildcardMatch = 2;
-const sal_Int32 Context::OptimalMatch = 0; // Neither application nor context name is "any".
+const sal_Int32 Context::OptimalMatch = 0; // Neither application nor context name is "any".
#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
Context::Context (void)
- : msApplication(A2S(AnyApplicationName)),
- msContext(A2S(AnyContextName))
+ : msApplication(A2S(AnyApplicationName)),
+ msContext(A2S(AnyContextName))
{
}
-
-
-
Context::Context (
- const ::rtl::OUString& rsApplication,
- const ::rtl::OUString& rsContext)
- : msApplication(rsApplication),
- msContext(rsContext)
+ const ::rtl::OUString& rsApplication,
+ const ::rtl::OUString& rsContext)
+ : msApplication(rsApplication),
+ msContext(rsContext)
{
}
-
-
-
sal_Int32 Context::EvaluateMatch (
- const Context& rOther) const
+ const Context& rOther) const
{
- const bool bApplicationNameIsAny (rOther.msApplication.equalsAscii(AnyApplicationName));
- if (rOther.msApplication.equals(msApplication) || bApplicationNameIsAny)
- {
- // Application name matches.
- const bool bContextNameIsAny (rOther.msContext.equalsAscii(AnyContextName));
- if (rOther.msContext.equals(msContext) || bContextNameIsAny)
- {
- // Context name matches.
- return (bApplicationNameIsAny ? ApplicationWildcardMatch : 0)
- + (bContextNameIsAny ? ContextWildcardMatch : 0);
- }
- }
- return NoMatch;
+ const bool bApplicationNameIsAny (rOther.msApplication.equalsAscii(AnyApplicationName));
+ if (rOther.msApplication.equals(msApplication) || bApplicationNameIsAny)
+ {
+ // Application name matches.
+ const bool bContextNameIsAny (rOther.msContext.equalsAscii(AnyContextName));
+ if (rOther.msContext.equals(msContext) || bContextNameIsAny)
+ {
+ // Context name matches.
+ return (bApplicationNameIsAny ? ApplicationWildcardMatch : 0)
+ + (bContextNameIsAny ? ContextWildcardMatch : 0);
+ }
+ }
+ return NoMatch;
}
-
-
-
sal_Int32 Context::EvaluateMatch (const ::std::vector<Context>& rOthers) const
{
- sal_Int32 nBestMatch (NoMatch);
+ sal_Int32 nBestMatch (NoMatch);
- for (::std::vector<Context>::const_iterator
- iContext(rOthers.begin()),
- iEnd(rOthers.end());
- iContext!=iEnd;
- ++iContext)
- {
- const sal_Int32 nMatch (EvaluateMatch(*iContext));
- if (nMatch < nBestMatch)
- {
- if (nMatch == OptimalMatch)
- {
- // We will find no better match so stop searching.
- return OptimalMatch;
- }
- nBestMatch = nMatch;
- }
- }
- return nBestMatch;
+ for (::std::vector<Context>::const_iterator
+ iContext(rOthers.begin()),
+ iEnd(rOthers.end());
+ iContext!=iEnd;
+ ++iContext)
+ {
+ const sal_Int32 nMatch (EvaluateMatch(*iContext));
+ if (nMatch < nBestMatch)
+ {
+ if (nMatch == OptimalMatch)
+ {
+ // We will find no better match so stop searching.
+ return OptimalMatch;
+ }
+ nBestMatch = nMatch;
+ }
+ }
+ return nBestMatch;
}
-
-
-
bool Context::operator== (const Context& rOther) const
{
- return msApplication.equals(rOther.msApplication)
- && msContext.equals(rOther.msContext);
+ return msApplication.equals(rOther.msApplication)
+ && msContext.equals(rOther.msContext);
}
-
-
-
bool Context::operator!= (const Context& rOther) const
{
- return ( ! msApplication.equals(rOther.msApplication))
- || ( ! msContext.equals(rOther.msContext));
+ return ( ! msApplication.equals(rOther.msApplication))
+ || ( ! msContext.equals(rOther.msContext));
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/CustomImageRadioButton.cxx b/main/sfx2/source/sidebar/CustomImageRadioButton.cxx
index b51c100..fe2c9f6 100644
--- a/main/sfx2/source/sidebar/CustomImageRadioButton.cxx
+++ b/main/sfx2/source/sidebar/CustomImageRadioButton.cxx
@@ -30,53 +30,50 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-
namespace sfx2 { namespace sidebar {
-
CustomImageRadioButton::CustomImageRadioButton (
- Window* pParentWindow,
- const ResId& rResId )
- : ImageRadioButton( pParentWindow, rResId )
+ Window* pParentWindow,
+ const ResId& rResId )
+ : ImageRadioButton( pParentWindow, rResId )
{
- SetStyle( GetStyle() | WB_NOPOINTERFOCUS );
+ SetStyle( GetStyle() | WB_NOPOINTERFOCUS );
}
-
CustomImageRadioButton::~CustomImageRadioButton (void)
{
}
-
void CustomImageRadioButton::Paint (const Rectangle& /* rUpdateArea */)
{
- Rectangle aPaintRect( Rectangle(Point(0,0), GetSizePixel() ) );
- SetMouseRect( aPaintRect );
- SetStateRect( aPaintRect );
+ Rectangle aPaintRect( Rectangle(Point(0,0), GetSizePixel() ) );
+ SetMouseRect( aPaintRect );
+ SetStateRect( aPaintRect );
- const Theme::ThemeItem eBackground =
- IsMouseOver()
- ? Theme::Paint_TabItemBackgroundHighlight
- : Theme::Paint_PanelBackground;
- DrawHelper::DrawRoundedRectangle(
- *this,
- aPaintRect,
- Theme::GetInteger(Theme::Int_ButtonCornerRadius),
- IsChecked() || IsMouseOver() ? Theme::GetColor(Theme::Color_TabItemBorder) : Color(0xffffffff),
- Theme::GetPaint( eBackground ) );
+ const Theme::ThemeItem eBackground =
+ IsMouseOver()
+ ? Theme::Paint_TabItemBackgroundHighlight
+ : Theme::Paint_PanelBackground;
+ DrawHelper::DrawRoundedRectangle(
+ *this,
+ aPaintRect,
+ Theme::GetInteger(Theme::Int_ButtonCornerRadius),
+ IsChecked() || IsMouseOver() ? Theme::GetColor(Theme::Color_TabItemBorder) : Color(0xffffffff),
+ Theme::GetPaint( eBackground ) );
- const Image aIcon (GetModeRadioImage(Theme::IsHighContrastMode()
- ? BMP_COLOR_HIGHCONTRAST
- : BMP_COLOR_NORMAL));
- const Size aIconSize (aIcon.GetSizePixel());
- const Point aIconLocation(
- (GetSizePixel().Width() - aIconSize.Width())/2,
- (GetSizePixel().Height() - aIconSize.Height())/2 );
- DrawImage(
- aIconLocation,
- aIcon,
- IsEnabled() ? 0 : IMAGE_DRAW_DISABLE );
+ const Image aIcon (GetModeRadioImage(Theme::IsHighContrastMode()
+ ? BMP_COLOR_HIGHCONTRAST
+ : BMP_COLOR_NORMAL));
+ const Size aIconSize (aIcon.GetSizePixel());
+ const Point aIconLocation(
+ (GetSizePixel().Width() - aIconSize.Width())/2,
+ (GetSizePixel().Height() - aIconSize.Height())/2 );
+ DrawImage(
+ aIconLocation,
+ aIcon,
+ IsEnabled() ? 0 : IMAGE_DRAW_DISABLE );
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/CustomImageRadioButton.hxx b/main/sfx2/source/sidebar/CustomImageRadioButton.hxx
index 616e32c..99d0fe8 100644
--- a/main/sfx2/source/sidebar/CustomImageRadioButton.hxx
+++ b/main/sfx2/source/sidebar/CustomImageRadioButton.hxx
@@ -31,19 +31,20 @@
/** A custom image radion button with more control over used colors for sidebar
*/
class CustomImageRadioButton
- : public ImageRadioButton
+ : public ImageRadioButton
{
public:
- CustomImageRadioButton(
- Window* pParentWindow,
- const ResId& rResId );
+ CustomImageRadioButton(
+ Window* pParentWindow,
+ const ResId& rResId );
- virtual ~CustomImageRadioButton(void);
+ virtual ~CustomImageRadioButton(void);
- virtual void Paint( const Rectangle& rUpdateArea );
+ virtual void Paint( const Rectangle& rUpdateArea );
};
-
} } // end of namespace sfx2::sidebar
#endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/Deck.cxx b/main/sfx2/source/sidebar/Deck.cxx
index 2c2f16d..19b8901 100644
--- a/main/sfx2/source/sidebar/Deck.cxx
+++ b/main/sfx2/source/sidebar/Deck.cxx
@@ -42,436 +42,363 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-
namespace sfx2 { namespace sidebar {
-
namespace {
- static const sal_Int32 MinimalPanelHeight (25);
+ static const sal_Int32 MinimalPanelHeight (25);
}
-
Deck::Deck (
- const DeckDescriptor& rDeckDescriptor,
- Window* pParentWindow,
- const ::boost::function<void(void)>& rCloserAction)
- : Window(pParentWindow, 0),
- msId(rDeckDescriptor.msId),
- maIcon(),
- msIconURL(rDeckDescriptor.msIconURL),
- msHighContrastIconURL(rDeckDescriptor.msHighContrastIconURL),
- maPanels(),
- mpTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, this, rCloserAction)),
- mpScrollClipWindow(new Window(this)),
- mpScrollContainer(new ScrollContainerWindow(mpScrollClipWindow.get())),
- mpFiller(new Window(this)),
- mpVerticalScrollBar(new ScrollBar(this))
+ const DeckDescriptor& rDeckDescriptor,
+ Window* pParentWindow,
+ const ::boost::function<void(void)>& rCloserAction)
+ : Window(pParentWindow, 0),
+ msId(rDeckDescriptor.msId),
+ maIcon(),
+ msIconURL(rDeckDescriptor.msIconURL),
+ msHighContrastIconURL(rDeckDescriptor.msHighContrastIconURL),
+ maPanels(),
+ mpTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, this, rCloserAction)),
+ mpScrollClipWindow(new Window(this)),
+ mpScrollContainer(new ScrollContainerWindow(mpScrollClipWindow.get())),
+ mpFiller(new Window(this)),
+ mpVerticalScrollBar(new ScrollBar(this))
{
- SetBackground(Wallpaper());
+ SetBackground(Wallpaper());
- mpScrollClipWindow->SetBackground(Wallpaper());
- mpScrollClipWindow->Show();
+ mpScrollClipWindow->SetBackground(Wallpaper());
+ mpScrollClipWindow->Show();
- mpScrollContainer->SetStyle(mpScrollContainer->GetStyle() | WB_DIALOGCONTROL);
- mpScrollContainer->SetBackground(Wallpaper());
- mpScrollContainer->Show();
+ mpScrollContainer->SetStyle(mpScrollContainer->GetStyle() | WB_DIALOGCONTROL);
+ mpScrollContainer->SetBackground(Wallpaper());
+ mpScrollContainer->Show();
- mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange));
+ mpVerticalScrollBar->SetScrollHdl(LINK(this, Deck, HandleVerticalScrollBarChange));
#ifdef DEBUG
- SetText(A2S("Deck"));
- mpScrollClipWindow->SetText(A2S("ScrollClipWindow"));
- mpFiller->SetText(A2S("Filler"));
- mpVerticalScrollBar->SetText(A2S("VerticalScrollBar"));
+ SetText(A2S("Deck"));
+ mpScrollClipWindow->SetText(A2S("ScrollClipWindow"));
+ mpFiller->SetText(A2S("Filler"));
+ mpVerticalScrollBar->SetText(A2S("VerticalScrollBar"));
#endif
}
-
-
-
Deck::~Deck (void)
{
- Dispose();
+ Dispose();
- // We have to explicitly trigger the destruction of panels.
- // Otherwise that is done by one of our base class destructors
- // without updating maPanels.
- maPanels.clear();
+ // We have to explicitly trigger the destruction of panels.
+ // Otherwise that is done by one of our base class destructors
+ // without updating maPanels.
+ maPanels.clear();
}
-
-
-
void Deck::Dispose (void)
{
- SharedPanelContainer aPanels;
- aPanels.swap(maPanels);
- for (SharedPanelContainer::iterator
- iPanel(aPanels.begin()),
- iEnd(aPanels.end());
- iPanel!=iEnd;
- ++iPanel)
- {
+ SharedPanelContainer aPanels;
+ aPanels.swap(maPanels);
+ for (SharedPanelContainer::iterator
+ iPanel(aPanels.begin()),
+ iEnd(aPanels.end());
+ iPanel!=iEnd;
+ ++iPanel)
+ {
if (*iPanel)
- {
+ {
(*iPanel)->Dispose();
- OSL_ASSERT(iPanel->unique());
- iPanel->reset();
- }
- }
+ OSL_ASSERT(iPanel->unique());
+ iPanel->reset();
+ }
+ }
- mpTitleBar.reset();
- mpFiller.reset();
- mpVerticalScrollBar.reset();
+ mpTitleBar.reset();
+ mpFiller.reset();
+ mpVerticalScrollBar.reset();
}
-
-
-
const ::rtl::OUString& Deck::GetId (void) const
{
- return msId;
+ return msId;
}
-
-
-
DeckTitleBar* Deck::GetTitleBar (void) const
{
- return mpTitleBar.get();
+ return mpTitleBar.get();
}
-
-
-
Rectangle Deck::GetContentArea (void) const
{
- const Size aWindowSize (GetSizePixel());
- const int nBorderSize (Theme::GetInteger(Theme::Int_DeckBorderSize));
+ const Size aWindowSize (GetSizePixel());
+ const int nBorderSize (Theme::GetInteger(Theme::Int_DeckBorderSize));
- return Rectangle(
- Theme::GetInteger(Theme::Int_DeckLeftPadding) + nBorderSize,
- Theme::GetInteger(Theme::Int_DeckTopPadding) + nBorderSize,
- aWindowSize.Width() - 1 - Theme::GetInteger(Theme::Int_DeckRightPadding) - nBorderSize,
- aWindowSize.Height() - 1 - Theme::GetInteger(Theme::Int_DeckBottomPadding) - nBorderSize);
+ return Rectangle(
+ Theme::GetInteger(Theme::Int_DeckLeftPadding) + nBorderSize,
+ Theme::GetInteger(Theme::Int_DeckTopPadding) + nBorderSize,
+ aWindowSize.Width() - 1 - Theme::GetInteger(Theme::Int_DeckRightPadding) - nBorderSize,
+ aWindowSize.Height() - 1 - Theme::GetInteger(Theme::Int_DeckBottomPadding) - nBorderSize);
}
-
-
-
::rtl::OUString Deck::GetIconURL (const bool bIsHighContrastModeActive) const
{
- if (bIsHighContrastModeActive)
- return msHighContrastIconURL;
- else
- return msIconURL;
+ if (bIsHighContrastModeActive)
+ return msHighContrastIconURL;
+ else
+ return msIconURL;
}
-
-
-
void Deck::Paint (const Rectangle& rUpdateArea)
{
- (void) rUpdateArea;
+ (void) rUpdateArea;
- const Size aWindowSize (GetSizePixel());
- const SvBorder aPadding (
- Theme::GetInteger(Theme::Int_DeckLeftPadding),
- Theme::GetInteger(Theme::Int_DeckTopPadding),
- Theme::GetInteger(Theme::Int_DeckRightPadding),
- Theme::GetInteger(Theme::Int_DeckBottomPadding));
+ const Size aWindowSize (GetSizePixel());
+ const SvBorder aPadding (
+ Theme::GetInteger(Theme::Int_DeckLeftPadding),
+ Theme::GetInteger(Theme::Int_DeckTopPadding),
+ Theme::GetInteger(Theme::Int_DeckRightPadding),
+ Theme::GetInteger(Theme::Int_DeckBottomPadding));
- // Paint deck background outside the border.
- Rectangle aBox(
- 0,
- 0,
- aWindowSize.Width() - 1,
- aWindowSize.Height() - 1);
- DrawHelper::DrawBorder(
- *this,
- aBox,
- aPadding,
- Theme::GetPaint(Theme::Paint_DeckBackground),
- Theme::GetPaint(Theme::Paint_DeckBackground));
+ // Paint deck background outside the border.
+ Rectangle aBox(
+ 0,
+ 0,
+ aWindowSize.Width() - 1,
+ aWindowSize.Height() - 1);
+ DrawHelper::DrawBorder(
+ *this,
+ aBox,
+ aPadding,
+ Theme::GetPaint(Theme::Paint_DeckBackground),
+ Theme::GetPaint(Theme::Paint_DeckBackground));
- // Paint the border.
- const int nBorderSize (Theme::GetInteger(Theme::Int_DeckBorderSize));
- aBox.Left() += aPadding.Left();
- aBox.Top() += aPadding.Top();
- aBox.Right() -= aPadding.Right();
- aBox.Bottom() -= aPadding.Bottom();
- const sfx2::sidebar::Paint& rHorizontalBorderPaint (Theme::GetPaint(Theme::Paint_HorizontalBorder));
- DrawHelper::DrawBorder(
- *this,
- aBox,
- SvBorder(nBorderSize, nBorderSize, nBorderSize, nBorderSize),
- rHorizontalBorderPaint,
- Theme::GetPaint(Theme::Paint_VerticalBorder));
+ // Paint the border.
+ const int nBorderSize (Theme::GetInteger(Theme::Int_DeckBorderSize));
+ aBox.Left() += aPadding.Left();
+ aBox.Top() += aPadding.Top();
+ aBox.Right() -= aPadding.Right();
+ aBox.Bottom() -= aPadding.Bottom();
+ const sfx2::sidebar::Paint& rHorizontalBorderPaint (Theme::GetPaint(Theme::Paint_HorizontalBorder));
+ DrawHelper::DrawBorder(
+ *this,
+ aBox,
+ SvBorder(nBorderSize, nBorderSize, nBorderSize, nBorderSize),
+ rHorizontalBorderPaint,
+ Theme::GetPaint(Theme::Paint_VerticalBorder));
}
-
-
-
void Deck::DataChanged (const DataChangedEvent& rEvent)
{
- (void)rEvent;
- RequestLayout();
+ (void)rEvent;
+ RequestLayout();
}
-
-
-
long Deck::Notify (NotifyEvent& rEvent)
{
- if (rEvent.GetType() == EVENT_COMMAND)
- {
- CommandEvent* pCommandEvent = reinterpret_cast<CommandEvent*>(rEvent.GetData());
- if (pCommandEvent != NULL)
- switch (pCommandEvent->GetCommand())
- {
- case COMMAND_WHEEL:
- return ProcessWheelEvent(pCommandEvent, rEvent)
- ? sal_True
- : sal_False;
+ if (rEvent.GetType() == EVENT_COMMAND)
+ {
+ CommandEvent* pCommandEvent = reinterpret_cast<CommandEvent*>(rEvent.GetData());
+ if (pCommandEvent != NULL)
+ switch (pCommandEvent->GetCommand())
+ {
+ case COMMAND_WHEEL:
+ return ProcessWheelEvent(pCommandEvent, rEvent)
+ ? sal_True
+ : sal_False;
- default:
- break;
- }
- }
+ default:
+ break;
+ }
+ }
- return Window::Notify(rEvent);
+ return Window::Notify(rEvent);
}
-
-
-
bool Deck::ProcessWheelEvent (
- CommandEvent* pCommandEvent,
- NotifyEvent& rEvent)
+ CommandEvent* pCommandEvent,
+ NotifyEvent& rEvent)
{
- if ( ! mpVerticalScrollBar)
- return false;
- if ( ! mpVerticalScrollBar->IsVisible())
- return false;
+ if ( ! mpVerticalScrollBar)
+ return false;
+ if ( ! mpVerticalScrollBar->IsVisible())
+ return false;
- // Ignore all wheel commands from outside the vertical scroll bar.
- // Otherwise after a scroll we might land on a spin field and
- // subsequent wheel events would change the value of that control.
- if (rEvent.GetWindow() != mpVerticalScrollBar.get())
- return true;
+ // Ignore all wheel commands from outside the vertical scroll bar.
+ // Otherwise after a scroll we might land on a spin field and
+ // subsequent wheel events would change the value of that control.
+ if (rEvent.GetWindow() != mpVerticalScrollBar.get())
+ return true;
- // Get the wheel data and check that it describes a valid vertical
- // scroll.
- const CommandWheelData* pData = pCommandEvent->GetWheelData();
- if (pData==NULL
- || pData->GetModifier()
- || pData->GetMode() != COMMAND_WHEEL_SCROLL
- || pData->IsHorz())
- return false;
+ // Get the wheel data and check that it describes a valid vertical
+ // scroll.
+ const CommandWheelData* pData = pCommandEvent->GetWheelData();
+ if (pData==NULL
+ || pData->GetModifier()
+ || pData->GetMode() != COMMAND_WHEEL_SCROLL
+ || pData->IsHorz())
+ return false;
- // Execute the actual scroll action.
- long nDelta = pData->GetDelta();
- mpVerticalScrollBar->DoScroll(
- mpVerticalScrollBar->GetThumbPos() - nDelta);
- return true;
+ // Execute the actual scroll action.
+ long nDelta = pData->GetDelta();
+ mpVerticalScrollBar->DoScroll(
+ mpVerticalScrollBar->GetThumbPos() - nDelta);
+ return true;
}
-
-
-
void Deck::SetPanels (const SharedPanelContainer& rPanels)
{
- maPanels = rPanels;
+ maPanels = rPanels;
- RequestLayout();
+ RequestLayout();
}
-
-
-
const SharedPanelContainer& Deck::GetPanels (void) const
{
- return maPanels;
+ return maPanels;
}
-
-
-
void Deck::RequestLayout (void)
{
- DeckLayouter::LayoutDeck(
- GetContentArea(),
- maPanels,
- *GetTitleBar(),
- *mpScrollClipWindow,
- *mpScrollContainer,
- *mpFiller,
- *mpVerticalScrollBar);
+ DeckLayouter::LayoutDeck(
+ GetContentArea(),
+ maPanels,
+ *GetTitleBar(),
+ *mpScrollClipWindow,
+ *mpScrollContainer,
+ *mpFiller,
+ *mpVerticalScrollBar);
}
-
-
-
::Window* Deck::GetPanelParentWindow (void)
{
- return mpScrollContainer.get();
+ return mpScrollContainer.get();
}
-
-
-
void Deck::ShowPanel (const Panel& rPanel)
{
- if (mpVerticalScrollBar && mpVerticalScrollBar->IsVisible())
- {
- // Get vertical extent of the panel.
- sal_Int32 nPanelTop (rPanel.GetPosPixel().Y());
- const sal_Int32 nPanelBottom (nPanelTop + rPanel.GetSizePixel().Height() - 1);
- // Add the title bar into the extent.
- if (rPanel.GetTitleBar() != NULL && rPanel.GetTitleBar()->IsVisible())
- nPanelTop = rPanel.GetTitleBar()->GetPosPixel().Y();
+ if (mpVerticalScrollBar && mpVerticalScrollBar->IsVisible())
+ {
+ // Get vertical extent of the panel.
+ sal_Int32 nPanelTop (rPanel.GetPosPixel().Y());
+ const sal_Int32 nPanelBottom (nPanelTop + rPanel.GetSizePixel().Height() - 1);
+ // Add the title bar into the extent.
+ if (rPanel.GetTitleBar() != NULL && rPanel.GetTitleBar()->IsVisible())
+ nPanelTop = rPanel.GetTitleBar()->GetPosPixel().Y();
- // Determine what the new thumb position should be like.
- // When the whole panel does not fit then make its top visible
- // and it off at the bottom.
- sal_Int32 nNewThumbPos (mpVerticalScrollBar->GetThumbPos());
- if (nPanelBottom >= nNewThumbPos+mpVerticalScrollBar->GetVisibleSize())
- nNewThumbPos = nPanelBottom - mpVerticalScrollBar->GetVisibleSize();
- if (nPanelTop < nNewThumbPos)
- nNewThumbPos = nPanelTop;
+ // Determine what the new thumb position should be like.
+ // When the whole panel does not fit then make its top visible
+ // and it off at the bottom.
+ sal_Int32 nNewThumbPos (mpVerticalScrollBar->GetThumbPos());
+ if (nPanelBottom >= nNewThumbPos+mpVerticalScrollBar->GetVisibleSize())
+ nNewThumbPos = nPanelBottom - mpVerticalScrollBar->GetVisibleSize();
+ if (nPanelTop < nNewThumbPos)
+ nNewThumbPos = nPanelTop;
- mpVerticalScrollBar->SetThumbPos(nNewThumbPos);
- mpScrollContainer->SetPosPixel(
- Point(
- mpScrollContainer->GetPosPixel().X(),
- -nNewThumbPos));
-
- }
+ mpVerticalScrollBar->SetThumbPos(nNewThumbPos);
+ mpScrollContainer->SetPosPixel(
+ Point(
+ mpScrollContainer->GetPosPixel().X(),
+ -nNewThumbPos));
+ }
}
-
-
-
const char* GetWindowClassification (const Window* pWindow)
{
- const String& rsName (pWindow->GetText());
- if (rsName.Len() > 0)
- {
- return ::rtl::OUStringToOString(rsName, RTL_TEXTENCODING_ASCII_US).getStr();
- }
- else
- {
- static char msWindow[] = "window";
- return msWindow;
- }
+ const String& rsName (pWindow->GetText());
+ if (rsName.Len() > 0)
+ {
+ return ::rtl::OUStringToOString(rsName, RTL_TEXTENCODING_ASCII_US).getStr();
+ }
+ else
+ {
+ static char msWindow[] = "window";
+ return msWindow;
+ }
}
-
void Deck::PrintWindowSubTree (Window* pRoot, int nIndentation)
{
- static const char* sIndentation = " ";
- const Point aLocation (pRoot->GetPosPixel());
- const Size aSize (pRoot->GetSizePixel());
- const char* sClassification = GetWindowClassification(pRoot);
- const char* sVisible = pRoot->IsVisible() ? "visible" : "hidden";
- OSL_TRACE("%s%x %s %s +%d+%d x%dx%d",
- sIndentation+strlen(sIndentation)-nIndentation*4,
- pRoot,
- sClassification,
- sVisible,
- aLocation.X(),aLocation.Y(),
- aSize.Width(),aSize.Height());
+ static const char* sIndentation = " ";
+ const Point aLocation (pRoot->GetPosPixel());
+ const Size aSize (pRoot->GetSizePixel());
+ const char* sClassification = GetWindowClassification(pRoot);
+ const char* sVisible = pRoot->IsVisible() ? "visible" : "hidden";
+ OSL_TRACE("%s%x %s %s +%d+%d x%dx%d",
+ sIndentation+strlen(sIndentation)-nIndentation*4,
+ pRoot,
+ sClassification,
+ sVisible,
+ aLocation.X(),aLocation.Y(),
+ aSize.Width(),aSize.Height());
- const sal_uInt16 nChildCount (pRoot->GetChildCount());
- for (sal_uInt16 nIndex=0; nIndex<nChildCount; ++nIndex)
- PrintWindowSubTree(pRoot->GetChild(nIndex), nIndentation+1);
+ const sal_uInt16 nChildCount (pRoot->GetChildCount());
+ for (sal_uInt16 nIndex=0; nIndex<nChildCount; ++nIndex)
+ PrintWindowSubTree(pRoot->GetChild(nIndex), nIndentation+1);
}
-
-
-
void Deck::PrintWindowTree (void)
{
- PrintWindowSubTree(this, 0);
+ PrintWindowSubTree(this, 0);
}
-
-
-
void Deck::PrintWindowTree (const ::std::vector<Panel*>& rPanels)
{
- (void)rPanels;
+ (void)rPanels;
- PrintWindowTree();
+ PrintWindowTree();
}
-
-
-
IMPL_LINK(Deck, HandleVerticalScrollBarChange,void*, EMPTYARG)
{
- const sal_Int32 nYOffset (-mpVerticalScrollBar->GetThumbPos());
- mpScrollContainer->SetPosPixel(
- Point(
- mpScrollContainer->GetPosPixel().X(),
- nYOffset));
- return sal_True;
+ const sal_Int32 nYOffset (-mpVerticalScrollBar->GetThumbPos());
+ mpScrollContainer->SetPosPixel(
+ Point(
+ mpScrollContainer->GetPosPixel().X(),
+ nYOffset));
+ return sal_True;
}
-
-
-
//----- Deck::ScrollContainerWindow -------------------------------------------
Deck::ScrollContainerWindow::ScrollContainerWindow (Window* pParentWindow)
- : Window(pParentWindow),
- maSeparators()
+ : Window(pParentWindow),
+ maSeparators()
{
#ifdef DEBUG
- SetText(A2S("ScrollContainerWindow"));
+ SetText(A2S("ScrollContainerWindow"));
#endif
}
-
-
-
Deck::ScrollContainerWindow::~ScrollContainerWindow (void)
{
}
-
-
-
void Deck::ScrollContainerWindow::Paint (const Rectangle& rUpdateArea)
{
- (void)rUpdateArea;
+ (void)rUpdateArea;
- // Paint the separators.
- const sal_Int32 nSeparatorHeight (Theme::GetInteger(Theme::Int_DeckSeparatorHeight));
- const sal_Int32 nLeft (0);
- const sal_Int32 nRight (GetSizePixel().Width()-1);
- const sfx2::sidebar::Paint& rHorizontalBorderPaint (Theme::GetPaint(Theme::Paint_HorizontalBorder));
- for (::std::vector<sal_Int32>::const_iterator iY(maSeparators.begin()), iEnd(maSeparators.end());
- iY!=iEnd;
- ++iY)
- {
- DrawHelper::DrawHorizontalLine(
- *this,
- nLeft,
- nRight,
- *iY,
- nSeparatorHeight,
- rHorizontalBorderPaint);
- }
+ // Paint the separators.
+ const sal_Int32 nSeparatorHeight (Theme::GetInteger(Theme::Int_DeckSeparatorHeight));
+ const sal_Int32 nLeft (0);
+ const sal_Int32 nRight (GetSizePixel().Width()-1);
+ const sfx2::sidebar::Paint& rHorizontalBorderPaint (Theme::GetPaint(Theme::Paint_HorizontalBorder));
+ for (::std::vector<sal_Int32>::const_iterator iY(maSeparators.begin()), iEnd(maSeparators.end());
+ iY!=iEnd;
+ ++iY)
+ {
+ DrawHelper::DrawHorizontalLine(
+ *this,
+ nLeft,
+ nRight,
+ *iY,
+ nSeparatorHeight,
+ rHorizontalBorderPaint);
+ }
}
-
-
-
void Deck::ScrollContainerWindow::SetSeparators (const ::std::vector<sal_Int32>& rSeparators)
{
- maSeparators = rSeparators;
+ maSeparators = rSeparators;
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/DeckConfiguration.cxx b/main/sfx2/source/sidebar/DeckConfiguration.cxx
index 1540d1b..710fe87 100644
--- a/main/sfx2/source/sidebar/DeckConfiguration.cxx
+++ b/main/sfx2/source/sidebar/DeckConfiguration.cxx
@@ -24,32 +24,28 @@
#include "DeckConfiguration.hxx"
#include "Deck.hxx"
-
namespace sfx2 { namespace sidebar {
DeckConfiguration::DeckConfiguration (void)
- : mpDeck(NULL),
- maPanels()
+ : mpDeck(NULL),
+ maPanels()
{
}
-
-
-
void DeckConfiguration::Dispose (void)
{
- if (mpDeck != NULL)
- {
- mpDeck->Dispose();
+ if (mpDeck != NULL)
+ {
+ mpDeck->Dispose();
- Deck* pDeck = mpDeck;
- mpDeck = NULL;
- OSL_TRACE("deleting deck window subtree");
- pDeck->PrintWindowTree();
- delete pDeck;
- }
+ Deck* pDeck = mpDeck;
+ mpDeck = NULL;
+ OSL_TRACE("deleting deck window subtree");
+ pDeck->PrintWindowTree();
+ delete pDeck;
+ }
}
-
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/DeckDescriptor.cxx b/main/sfx2/source/sidebar/DeckDescriptor.cxx
index 2fa2823..ec6f203 100644
--- a/main/sfx2/source/sidebar/DeckDescriptor.cxx
+++ b/main/sfx2/source/sidebar/DeckDescriptor.cxx
@@ -26,43 +26,39 @@
namespace sfx2 { namespace sidebar {
DeckDescriptor::DeckDescriptor (void)
- : msTitle(),
- msId(),
- msIconURL(),
- msHighContrastIconURL(),
- msTitleBarIconURL(),
- msHighContrastTitleBarIconURL(),
- msHelpURL(),
- msHelpText(),
- maContextList(),
- mbIsEnabled(true),
- mnOrderIndex(10000) // Default value as defined in Sidebar.xcs
+ : msTitle(),
+ msId(),
+ msIconURL(),
+ msHighContrastIconURL(),
+ msTitleBarIconURL(),
+ msHighContrastTitleBarIconURL(),
+ msHelpURL(),
+ msHelpText(),
+ maContextList(),
+ mbIsEnabled(true),
+ mnOrderIndex(10000) // Default value as defined in Sidebar.xcs
{
}
-
-
-
DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther)
- : msTitle(rOther.msTitle),
- msId(rOther.msId),
- msIconURL(rOther.msIconURL),
- msHighContrastIconURL(rOther.msHighContrastIconURL),
- msTitleBarIconURL(rOther.msTitleBarIconURL),
- msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
- msHelpURL(rOther.msHelpURL),
- msHelpText(rOther.msHelpText),
- maContextList(rOther.maContextList),
- mbIsEnabled(rOther.mbIsEnabled),
- mnOrderIndex(rOther.mnOrderIndex)
+ : msTitle(rOther.msTitle),
+ msId(rOther.msId),
+ msIconURL(rOther.msIconURL),
+ msHighContrastIconURL(rOther.msHighContrastIconURL),
+ msTitleBarIconURL(rOther.msTitleBarIconURL),
+ msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
+ msHelpURL(rOther.msHelpURL),
+ msHelpText(rOther.msHelpText),
+ maContextList(rOther.maContextList),
+ mbIsEnabled(rOther.mbIsEnabled),
+ mnOrderIndex(rOther.mnOrderIndex)
{
}
-
-
-
DeckDescriptor::~DeckDescriptor (void)
{
}
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/DeckTitleBar.cxx b/main/sfx2/source/sidebar/DeckTitleBar.cxx
index bd9e86c..e484d27 100644
--- a/main/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/main/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -32,131 +32,104 @@
#include "sfx2/sidebar/Tools.hxx"
#endif
-
namespace sfx2 { namespace sidebar {
static const sal_Int32 gaLeftGripPadding (3);
-static const sal_Int32 gaRightGripPadding (3);
+static const sal_Int32 gaRightGripPadding (4);
DeckTitleBar::DeckTitleBar (
- const ::rtl::OUString& rsTitle,
- Window* pParentWindow,
- const ::boost::function<void(void)>& rCloserAction)
- : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
- mnCloserItemIndex(1),
- maCloserAction(rCloserAction),
- mbIsCloserVisible(false)
+ const ::rtl::OUString& rsTitle,
+ Window* pParentWindow,
+ const ::boost::function<void(void)>& rCloserAction)
+ : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
+ mnCloserItemIndex(1),
+ maCloserAction(rCloserAction),
+ mbIsCloserVisible(false)
{
- OSL_ASSERT(pParentWindow != NULL);
+ OSL_ASSERT(pParentWindow != NULL);
- if (maCloserAction)
- SetCloserVisible(true);
+ if (maCloserAction)
+ SetCloserVisible(true);
#ifdef DEBUG
- SetText(A2S("DeckTitleBar"));
+ SetText(A2S("DeckTitleBar"));
#endif
}
-
-
-
DeckTitleBar::~DeckTitleBar (void)
{
}
-
-
-
void DeckTitleBar::SetCloserVisible (const bool bIsCloserVisible)
{
- if (mbIsCloserVisible != bIsCloserVisible)
- {
- mbIsCloserVisible = bIsCloserVisible;
+ if (mbIsCloserVisible != bIsCloserVisible)
+ {
+ mbIsCloserVisible = bIsCloserVisible;
- if (mbIsCloserVisible)
- {
- maToolBox.InsertItem(
- mnCloserItemIndex,
- Theme::GetImage(Theme::Image_Closer));
- maToolBox.SetQuickHelpText(
- mnCloserItemIndex,
- String(SfxResId(SFX_STR_SIDEBAR_CLOSE_DECK)));
- }
- else
- maToolBox.RemoveItem(
- maToolBox.GetItemPos(mnCloserItemIndex));
- }
+ if (mbIsCloserVisible)
+ {
+ maToolBox.InsertItem(
+ mnCloserItemIndex,
+ Theme::GetImage(Theme::Image_Closer));
+ maToolBox.SetQuickHelpText(
+ mnCloserItemIndex,
+ String(SfxResId(SFX_STR_SIDEBAR_CLOSE_DECK)));
+ }
+ else
+ maToolBox.RemoveItem(
+ maToolBox.GetItemPos(mnCloserItemIndex));
+ }
}
-
-
-
Rectangle DeckTitleBar::GetTitleArea (const Rectangle& rTitleBarBox)
{
- Image aGripImage (Theme::GetImage(Theme::Image_Grip));
- return Rectangle(
- aGripImage.GetSizePixel().Width() + gaLeftGripPadding + gaRightGripPadding,
- rTitleBarBox.Top(),
- rTitleBarBox.Right(),
- rTitleBarBox.Bottom());
+ Image aGripImage (Theme::GetImage(Theme::Image_Grip));
+ return Rectangle(
+ aGripImage.GetSizePixel().Width() + gaLeftGripPadding + gaRightGripPadding,
+ rTitleBarBox.Top(),
+ rTitleBarBox.Right(),
+ rTitleBarBox.Bottom());
}
-
-
-
void DeckTitleBar::PaintDecoration (const Rectangle& rTitleBarBox)
{
- (void)rTitleBarBox;
+ (void)rTitleBarBox;
}
-
-
-
sidebar::Paint DeckTitleBar::GetBackgroundPaint (void)
{
- return Theme::GetPaint(Theme::Paint_DeckTitleBarBackground);
+ return Theme::GetPaint(Theme::Paint_DeckTitleBarBackground);
}
-
-
-
Color DeckTitleBar::GetTextColor (void)
{
- return Theme::GetColor(Theme::Color_DeckTitleFont);
+ return Theme::GetColor(Theme::Color_DeckTitleFont);
}
-
-
-
void DeckTitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex)
{
- if (nItemIndex == mnCloserItemIndex)
- if (maCloserAction)
- maCloserAction();
+ if (nItemIndex == mnCloserItemIndex)
+ if (maCloserAction)
+ maCloserAction();
}
-
-
-
cssu::Reference<css::accessibility::XAccessible> DeckTitleBar::CreateAccessible (void)
{
- const ::rtl::OUString sAccessibleName(msTitle);
- SetAccessibleName(sAccessibleName);
- SetAccessibleDescription(sAccessibleName);
- return TitleBar::CreateAccessible();
+ const ::rtl::OUString sAccessibleName(msTitle);
+ SetAccessibleName(sAccessibleName);
+ SetAccessibleDescription(sAccessibleName);
+ return TitleBar::CreateAccessible();
}
-
-
-
void DeckTitleBar::DataChanged (const DataChangedEvent& rEvent)
{
- maToolBox.SetItemImage(
- mnCloserItemIndex,
- Theme::GetImage(Theme::Image_Closer));
- TitleBar::DataChanged(rEvent);
+ maToolBox.SetItemImage(
+ mnCloserItemIndex,
+ Theme::GetImage(Theme::Image_Closer));
+ TitleBar::DataChanged(rEvent);
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/PanelDescriptor.cxx b/main/sfx2/source/sidebar/PanelDescriptor.cxx
index a602fa0..12b54ff 100644
--- a/main/sfx2/source/sidebar/PanelDescriptor.cxx
+++ b/main/sfx2/source/sidebar/PanelDescriptor.cxx
@@ -23,49 +23,44 @@
#include "PanelDescriptor.hxx"
-
namespace sfx2 { namespace sidebar {
PanelDescriptor::PanelDescriptor (void)
- : msTitle(),
- mbIsTitleBarOptional(false),
- msId(),
- msDeckId(),
- msTitleBarIconURL(),
- msHighContrastTitleBarIconURL(),
- msHelpURL(),
- maContextList(),
- msImplementationURL(),
- mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
- mbShowForReadOnlyDocuments(false),
- mbWantsCanvas(false)
+ : msTitle(),
+ mbIsTitleBarOptional(false),
+ msId(),
+ msDeckId(),
+ msTitleBarIconURL(),
+ msHighContrastTitleBarIconURL(),
+ msHelpURL(),
+ maContextList(),
+ msImplementationURL(),
+ mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
+ mbShowForReadOnlyDocuments(false),
+ mbWantsCanvas(false)
{
}
-
-
-
PanelDescriptor::PanelDescriptor (const PanelDescriptor& rOther)
- : msTitle(rOther.msTitle),
- mbIsTitleBarOptional(rOther.mbIsTitleBarOptional),
- msId(rOther.msId),
- msDeckId(rOther.msDeckId),
- msTitleBarIconURL(rOther.msTitleBarIconURL),
- msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
- msHelpURL(rOther.msHelpURL),
- maContextList(rOther.maContextList),
- msImplementationURL(rOther.msImplementationURL),
- mnOrderIndex(rOther.mnOrderIndex),
- mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments),
- mbWantsCanvas(rOther.mbWantsCanvas)
+ : msTitle(rOther.msTitle),
+ mbIsTitleBarOptional(rOther.mbIsTitleBarOptional),
+ msId(rOther.msId),
+ msDeckId(rOther.msDeckId),
+ msTitleBarIconURL(rOther.msTitleBarIconURL),
+ msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
+ msHelpURL(rOther.msHelpURL),
+ maContextList(rOther.maContextList),
+ msImplementationURL(rOther.msImplementationURL),
+ mnOrderIndex(rOther.mnOrderIndex),
+ mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments),
+ mbWantsCanvas(rOther.mbWantsCanvas)
{
}
-
-
PanelDescriptor::~PanelDescriptor (void)
{
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/PanelTitleBar.cxx b/main/sfx2/source/sidebar/PanelTitleBar.cxx
index a8d1048..0b0aa7d 100644
--- a/main/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/main/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -40,207 +40,174 @@
namespace sfx2 { namespace sidebar {
-
static const sal_Int32 gaLeftIconPadding (5);
static const sal_Int32 gaRightIconPadding (5);
-
PanelTitleBar::PanelTitleBar (
- const ::rtl::OUString& rsTitle,
- Window* pParentWindow,
- Panel* pPanel)
- : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
- mbIsLeftButtonDown(false),
- mpPanel(pPanel),
- mnMenuItemIndex(1),
- mxFrame(),
- msMoreOptionsCommand(),
- msAccessibleNamePrefix(String(SfxResId(SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX)))
+ const ::rtl::OUString& rsTitle,
+ Window* pParentWindow,
+ Panel* pPanel)
+ : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()),
+ mbIsLeftButtonDown(false),
+ mpPanel(pPanel),
+ mnMenuItemIndex(1),
+ mxFrame(),
+ msMoreOptionsCommand(),
+ msAccessibleNamePrefix(String(SfxResId(SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX)))
{
- OSL_ASSERT(mpPanel != NULL);
+ OSL_ASSERT(mpPanel != NULL);
#ifdef DEBUG
- SetText(A2S("PanelTitleBar"));
+ SetText(A2S("PanelTitleBar"));
#endif
}
-
-
-
PanelTitleBar::~PanelTitleBar (void)
{
}
-
-
-
void PanelTitleBar::SetMoreOptionsCommand (
- const ::rtl::OUString& rsCommandName,
- const ::cssu::Reference<css::frame::XFrame>& rxFrame)
+ const ::rtl::OUString& rsCommandName,
+ const ::cssu::Reference<css::frame::XFrame>& rxFrame)
{
- if ( ! rsCommandName.equals(msMoreOptionsCommand))
- {
- if (msMoreOptionsCommand.getLength() > 0)
- maToolBox.RemoveItem(maToolBox.GetItemPos(mnMenuItemIndex));
+ if ( ! rsCommandName.equals(msMoreOptionsCommand))
+ {
+ if (msMoreOptionsCommand.getLength() > 0)
+ maToolBox.RemoveItem(maToolBox.GetItemPos(mnMenuItemIndex));
- msMoreOptionsCommand = rsCommandName;
- mxFrame = rxFrame;
+ msMoreOptionsCommand = rsCommandName;
+ mxFrame = rxFrame;
- if (msMoreOptionsCommand.getLength() > 0)
- {
- maToolBox.InsertItem(
- mnMenuItemIndex,
- Theme::GetImage(Theme::Image_PanelMenu));
- Reference<frame::XToolbarController> xController (
- ControllerFactory::CreateToolBoxController(
- &maToolBox,
- mnMenuItemIndex,
- msMoreOptionsCommand,
- rxFrame,
- VCLUnoHelper::GetInterface(&maToolBox),
- 0));
- maToolBox.SetController(mnMenuItemIndex, xController, msMoreOptionsCommand);
- maToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT);
- maToolBox.SetQuickHelpText(
- mnMenuItemIndex,
- String(SfxResId(SFX_STR_SIDEBAR_MORE_OPTIONS)));
- }
- }
+ if (msMoreOptionsCommand.getLength() > 0)
+ {
+ maToolBox.InsertItem(
+ mnMenuItemIndex,
+ Theme::GetImage(Theme::Image_PanelMenu));
+ Reference<frame::XToolbarController> xController (
+ ControllerFactory::CreateToolBoxController(
+ &maToolBox,
+ mnMenuItemIndex,
+ msMoreOptionsCommand,
+ rxFrame,
+ VCLUnoHelper::GetInterface(&maToolBox),
+ 0));
+ maToolBox.SetController(mnMenuItemIndex, xController, msMoreOptionsCommand);
+ maToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT);
+ maToolBox.SetQuickHelpText(
+ mnMenuItemIndex,
+ String(SfxResId(SFX_STR_SIDEBAR_MORE_OPTIONS)));
+ }
+ }
}
-
-
-
Rectangle PanelTitleBar::GetTitleArea (const Rectangle& rTitleBarBox)
{
- if (mpPanel != NULL)
- {
- Image aImage (mpPanel->IsExpanded()
- ? Theme::GetImage(Theme::Image_Expand)
- : Theme::GetImage(Theme::Image_Collapse));
- return Rectangle(
- aImage.GetSizePixel().Width() + gaLeftIconPadding + gaRightIconPadding,
- rTitleBarBox.Top(),
- rTitleBarBox.Right(),
- rTitleBarBox.Bottom());
- }
- else
- return rTitleBarBox;
+ if (mpPanel != NULL)
+ {
+ Image aImage (mpPanel->IsExpanded()
+ ? Theme::GetImage(Theme::Image_Expand)
+ : Theme::GetImage(Theme::Image_Collapse));
+ return Rectangle(
+ aImage.GetSizePixel().Width() + gaLeftIconPadding + gaRightIconPadding,
+ rTitleBarBox.Top(),
+ rTitleBarBox.Right(),
+ rTitleBarBox.Bottom());
+ }
+ else
+ return rTitleBarBox;
}
-
-
-
void PanelTitleBar::PaintDecoration (const Rectangle& rTitleBarBox)
{
- (void)rTitleBarBox;
+ (void)rTitleBarBox;
- if (mpPanel != NULL)
- {
- Image aImage (mpPanel->IsExpanded()
- ? Theme::GetImage(Theme::Image_Collapse)
- : Theme::GetImage(Theme::Image_Expand));
- const Point aTopLeft (
- gaLeftIconPadding,
- (GetSizePixel().Height()-aImage.GetSizePixel().Height())/2);
- DrawImage(aTopLeft, aImage);
- }
+ if (mpPanel != NULL)
+ {
+ Image aImage (mpPanel->IsExpanded()
+ ? Theme::GetImage(Theme::Image_Collapse)
+ : Theme::GetImage(Theme::Image_Expand));
+ const Point aTopLeft (
+ gaLeftIconPadding,
+ (GetSizePixel().Height()-aImage.GetSizePixel().Height())/2);
+ DrawImage(aTopLeft, aImage);
+ }
}
-
-
-
Paint PanelTitleBar::GetBackgroundPaint (void)
{
- return Theme::GetPaint(Theme::Paint_PanelTitleBarBackground);
+ return Theme::GetPaint(Theme::Paint_PanelTitleBarBackground);
}
-
-
-
Color PanelTitleBar::GetTextColor (void)
{
- return Theme::GetColor(Theme::Color_PanelTitleFont);
+ return Theme::GetColor(Theme::Color_PanelTitleFont);
}
-
-
-
void PanelTitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex)
{
- if (nItemIndex == mnMenuItemIndex)
- if (msMoreOptionsCommand.getLength() > 0)
- {
- try
- {
- const util::URL aURL (Tools::GetURL(msMoreOptionsCommand));
- Reference<frame::XDispatch> xDispatch (Tools::GetDispatch(mxFrame, aURL));
- if (xDispatch.is())
- xDispatch->dispatch(aURL, Sequence<beans::PropertyValue>());
- }
- catch(Exception& rException)
- {
- OSL_TRACE("caught exception: %s",
- OUStringToOString(rException.Message, RTL_TEXTENCODING_ASCII_US).getStr());
- }
- }
+ if (nItemIndex == mnMenuItemIndex)
+ if (msMoreOptionsCommand.getLength() > 0)
+ {
+ try
+ {
+ const util::URL aURL (Tools::GetURL(msMoreOptionsCommand));
+ Reference<frame::XDispatch> xDispatch (Tools::GetDispatch(mxFrame, aURL));
+ if (xDispatch.is())
+ xDispatch->dispatch(aURL, Sequence<beans::PropertyValue>());
+ }
+ catch(Exception& rException)
+ {
+ OSL_TRACE("caught exception: %s",
+ OUStringToOString(rException.Message, RTL_TEXTENCODING_ASCII_US).getStr());
+ }
+ }
}
-
-
-
Reference<accessibility::XAccessible> PanelTitleBar::CreateAccessible (void)
{
- const ::rtl::OUString sAccessibleName(msAccessibleNamePrefix + msTitle);
- SetAccessibleName(sAccessibleName);
- SetAccessibleDescription(sAccessibleName);
- return TitleBar::CreateAccessible();
+ const ::rtl::OUString sAccessibleName(msAccessibleNamePrefix + msTitle);
+ SetAccessibleName(sAccessibleName);
+ SetAccessibleDescription(sAccessibleName);
+ return TitleBar::CreateAccessible();
}
-
-
-
void PanelTitleBar::MouseButtonDown (const MouseEvent& rMouseEvent)
{
- if (rMouseEvent.IsLeft())
- {
- mbIsLeftButtonDown = true;
- CaptureMouse();
- }
+ if (rMouseEvent.IsLeft())
+ {
+ mbIsLeftButtonDown = true;
+ CaptureMouse();
+ }
}
-
-
-
void PanelTitleBar::MouseButtonUp (const MouseEvent& rMouseEvent)
{
- if (IsMouseCaptured())
- ReleaseMouse();
+ if (IsMouseCaptured())
+ ReleaseMouse();
- if (rMouseEvent.IsLeft())
- {
- if (mbIsLeftButtonDown)
- {
- if (mpPanel != NULL)
- {
- mpPanel->SetExpanded( ! mpPanel->IsExpanded());
- Invalidate();
- }
- }
- }
- if (mbIsLeftButtonDown)
- mbIsLeftButtonDown = false;
+ if (rMouseEvent.IsLeft())
+ {
+ if (mbIsLeftButtonDown)
+ {
+ if (mpPanel != NULL)
+ {
+ mpPanel->SetExpanded( ! mpPanel->IsExpanded());
+ Invalidate();
+ }
+ }
+ }
+ if (mbIsLeftButtonDown)
+ mbIsLeftButtonDown = false;
}
-
-
-
void PanelTitleBar::DataChanged (const DataChangedEvent& rEvent)
{
- maToolBox.SetItemImage(
- mnMenuItemIndex,
- Theme::GetImage(Theme::Image_PanelMenu));
- TitleBar::DataChanged(rEvent);
+ maToolBox.SetItemImage(
+ mnMenuItemIndex,
+ Theme::GetImage(Theme::Image_PanelMenu));
+ TitleBar::DataChanged(rEvent);
}
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/Sidebar.cxx b/main/sfx2/source/sidebar/Sidebar.cxx
index 8e26495..e92acf7 100644
--- a/main/sfx2/source/sidebar/Sidebar.cxx
+++ b/main/sfx2/source/sidebar/Sidebar.cxx
@@ -30,37 +30,35 @@
namespace sfx2 { namespace sidebar {
-
void Sidebar::ShowPanel (
- const ::rtl::OUString& rsPanelId,
- const Reference<frame::XFrame>& rxFrame)
+ const ::rtl::OUString& rsPanelId,
+ const Reference<frame::XFrame>& rxFrame)
{
- SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
- const PanelDescriptor* pPanelDescriptor = ResourceManager::Instance().GetPanelDescriptor(rsPanelId);
- if (pController!=NULL && pPanelDescriptor != NULL)
- {
- // This should be a lot more sophisticated:
- // - Make the deck switching asynchronous
- // - Make sure that the panel is visible and expanded after
- // the switch.
- // - Make sure to use a context that really shows the panel
- //
- // All that is not necessary for the current use cases so lets
- // keep it simple for the time being.
- pController->RequestSwitchToDeck(pPanelDescriptor->msDeckId);
- }
+ SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
+ const PanelDescriptor* pPanelDescriptor = ResourceManager::Instance().GetPanelDescriptor(rsPanelId);
+ if (pController!=NULL && pPanelDescriptor != NULL)
+ {
+ // This should be a lot more sophisticated:
+ // - Make the deck switching asynchronous
+ // - Make sure that the panel is visible and expanded after
+ // the switch.
+ // - Make sure to use a context that really shows the panel
+ //
+ // All that is not necessary for the current use cases so let's
+ // keep it simple for the time being.
+ pController->RequestSwitchToDeck(pPanelDescriptor->msDeckId);
+ }
}
-
-
-
void Sidebar::ShowDeck (
- const ::rtl::OUString& rsDeckId,
- const Reference<frame::XFrame>& rxFrame)
+ const ::rtl::OUString& rsDeckId,
+ const Reference<frame::XFrame>& rxFrame)
{
- SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
- if (pController != NULL)
- pController->RequestSwitchToDeck(rsDeckId);
+ SidebarController* pController = SidebarController::GetSidebarControllerForFrame(rxFrame);
+ if (pController != NULL)
+ pController->RequestSwitchToDeck(rsDeckId);
}
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/Sidebar.hrc b/main/sfx2/source/sidebar/Sidebar.hrc
index 51388fc..d80ed6f 100644
--- a/main/sfx2/source/sidebar/Sidebar.hrc
+++ b/main/sfx2/source/sidebar/Sidebar.hrc
@@ -19,73 +19,72 @@
*
*************************************************************/
-
#include <sfx2/sfx.hrc>
-#define RID_SIDEBAR_RESOURCE (RID_SFX_SIDEBAR_START + 0)
+#define RID_SIDEBAR_RESOURCE (RID_SFX_SIDEBAR_START + 0)
-#define IMAGE_SIDEBAR_PLUS 1
-#define IMAGE_SIDEBAR_PLUS_HC 2
-#define IMAGE_SIDEBAR_MINUS 3
-#define IMAGE_SIDEBAR_MINUS_HC 4
-#define IMAGE_SIDEBAR_GRIP 5
-#define IMAGE_SIDEBAR_GRIP_HC 6
-#define IMAGE_SIDEBAR_MENU 7
-#define IMAGE_SIDEBAR_MENU_HC 8
-#define IMAGE_SIDEBAR_DETAIL_DIALOG 9
-#define IMAGE_SIDEBAR_DETAIL_DIALOG_HC 10
-#define IMAGE_SIDEBAR_TOOLBOX_SEPARATOR 11
-#define IMAGE_SIDEBAR_DECK_3D_LARGE 20
-#define IMAGE_SIDEBAR_DECK_3D_LARGE_HC 21
-#define IMAGE_SIDEBAR_DECK_3D_SMALL 22
-#define IMAGE_SIDEBAR_DECK_3D_SMALL_HC 23
-#define IMAGE_SIDEBAR_DECK_ANIMATION_LARGE 30
-#define IMAGE_SIDEBAR_DECK_ANIMATION_LARGE_HC 31
-#define IMAGE_SIDEBAR_DECK_ANIMATION_SMALL 32
-#define IMAGE_SIDEBAR_DECK_ANIMATION_SMALL_HC 33
-#define IMAGE_SIDEBAR_DECK_COLORS_LARGE 40
-#define IMAGE_SIDEBAR_DECK_COLORS_LARGE_HC 41
-#define IMAGE_SIDEBAR_DECK_COLORS_SMALL 42
-#define IMAGE_SIDEBAR_DECK_COLORS_SMALL_HC 43
-#define IMAGE_SIDEBAR_DECK_EYEDROPPER_LARGE 50
-#define IMAGE_SIDEBAR_DECK_EYEDROPPER_LARGE_HC 51
-#define IMAGE_SIDEBAR_DECK_EYEDROPPER_SMALL 52
-#define IMAGE_SIDEBAR_DECK_EYEDROPPER_SMALL_HC 53
-#define IMAGE_SIDEBAR_DECK_GALLERY_LARGE 60
-#define IMAGE_SIDEBAR_DECK_GALLERY_LARGE_HC 61
-#define IMAGE_SIDEBAR_DECK_GALLERY_SMALL 62
-#define IMAGE_SIDEBAR_DECK_GALLERY_SMALL_HC 63
-#define IMAGE_SIDEBAR_DECK_IMGANIM_LARGE 70
-#define IMAGE_SIDEBAR_DECK_IMGANIM_LARGE_HC 71
-#define IMAGE_SIDEBAR_DECK_IMGANIM_SMALL 72
-#define IMAGE_SIDEBAR_DECK_IMGANIM_SMALL_HC 73
-#define IMAGE_SIDEBAR_DECK_NAVIGATOR_LARGE 80
-#define IMAGE_SIDEBAR_DECK_NAVIGATOR_LARGE_HC 81
-#define IMAGE_SIDEBAR_DECK_NAVIGATOR_SMALL 82
-#define IMAGE_SIDEBAR_DECK_NAVIGATOR_SMALL_HC 83
-#define IMAGE_SIDEBAR_PROPERTIES_DECK_LARGE 90
-#define IMAGE_SIDEBAR_PROPERTIES_DECK_LARGE_HC 91
-#define IMAGE_SIDEBAR_PROPERTIES_DECK_SMALL 92
-#define IMAGE_SIDEBAR_PROPERTIES_DECK_SMALL_HC 93
-#define IMAGE_SIDEBAR_DECK_STYLE_LARGE 100
-#define IMAGE_SIDEBAR_DECK_STYLE_LARGE_HC 101
-#define IMAGE_SIDEBAR_DECK_STYLE_SMALL 102
-#define IMAGE_SIDEBAR_DECK_STYLE_SMALL_HC 103
-#define IMAGE_SIDEBAR_DECK_TEMPLATE_LARGE 110
-#define IMAGE_SIDEBAR_DECK_TEMPLATE_LARGE_HC 111
-#define IMAGE_SIDEBAR_DECK_TEMPLATE_SMALL 112
-#define IMAGE_SIDEBAR_DECK_TEMPLATE_SMALL_HC 113
-#define IMAGE_SIDEBAR_DECK_TRANSITION_LARGE 120
-#define IMAGE_SIDEBAR_DECK_TRANSITION_LARGE_HC 121
-#define IMAGE_SIDEBAR_DECK_TRANSITION_SMALL 122
-#define IMAGE_SIDEBAR_DECK_TRANSITION_SMALL_HC 123
-#define IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE 130
-#define IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE_HC 131
-#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL 132
-#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL_HC 133
-#define STRING_CUSTOMIZATION 200
-#define STRING_RESTORE 201
+#define IMAGE_SIDEBAR_PLUS 1
+#define IMAGE_SIDEBAR_PLUS_HC 2
+#define IMAGE_SIDEBAR_MINUS 3
+#define IMAGE_SIDEBAR_MINUS_HC 4
+#define IMAGE_SIDEBAR_GRIP 5
+#define IMAGE_SIDEBAR_GRIP_HC 6
+#define IMAGE_SIDEBAR_MENU 7
+#define IMAGE_SIDEBAR_MENU_HC 8
+#define IMAGE_SIDEBAR_DETAIL_DIALOG 9
+#define IMAGE_SIDEBAR_DETAIL_DIALOG_HC 10
+#define IMAGE_SIDEBAR_TOOLBOX_SEPARATOR 11
+#define IMAGE_SIDEBAR_DECK_3D_LARGE 20
+#define IMAGE_SIDEBAR_DECK_3D_LARGE_HC 21
+#define IMAGE_SIDEBAR_DECK_3D_SMALL 22
+#define IMAGE_SIDEBAR_DECK_3D_SMALL_HC 23
+#define IMAGE_SIDEBAR_DECK_ANIMATION_LARGE 30
+#define IMAGE_SIDEBAR_DECK_ANIMATION_LARGE_HC 31
+#define IMAGE_SIDEBAR_DECK_ANIMATION_SMALL 32
+#define IMAGE_SIDEBAR_DECK_ANIMATION_SMALL_HC 33
+#define IMAGE_SIDEBAR_DECK_COLORS_LARGE 40
+#define IMAGE_SIDEBAR_DECK_COLORS_LARGE_HC 41
+#define IMAGE_SIDEBAR_DECK_COLORS_SMALL 42
+#define IMAGE_SIDEBAR_DECK_COLORS_SMALL_HC 43
+#define IMAGE_SIDEBAR_DECK_EYEDROPPER_LARGE 50
+#define IMAGE_SIDEBAR_DECK_EYEDROPPER_LARGE_HC 51
+#define IMAGE_SIDEBAR_DECK_EYEDROPPER_SMALL 52
+#define IMAGE_SIDEBAR_DECK_EYEDROPPER_SMALL_HC 53
+#define IMAGE_SIDEBAR_DECK_GALLERY_LARGE 60
+#define IMAGE_SIDEBAR_DECK_GALLERY_LARGE_HC 61
+#define IMAGE_SIDEBAR_DECK_GALLERY_SMALL 62
+#define IMAGE_SIDEBAR_DECK_GALLERY_SMALL_HC 63
+#define IMAGE_SIDEBAR_DECK_IMGANIM_LARGE 70
+#define IMAGE_SIDEBAR_DECK_IMGANIM_LARGE_HC 71
+#define IMAGE_SIDEBAR_DECK_IMGANIM_SMALL 72
+#define IMAGE_SIDEBAR_DECK_IMGANIM_SMALL_HC 73
+#define IMAGE_SIDEBAR_DECK_NAVIGATOR_LARGE 80
+#define IMAGE_SIDEBAR_DECK_NAVIGATOR_LARGE_HC 81
+#define IMAGE_SIDEBAR_DECK_NAVIGATOR_SMALL 82
+#define IMAGE_SIDEBAR_DECK_NAVIGATOR_SMALL_HC 83
+#define IMAGE_SIDEBAR_PROPERTIES_DECK_LARGE 90
+#define IMAGE_SIDEBAR_PROPERTIES_DECK_LARGE_HC 91
+#define IMAGE_SIDEBAR_PROPERTIES_DECK_SMALL 92
+#define IMAGE_SIDEBAR_PROPERTIES_DECK_SMALL_HC 93
+#define IMAGE_SIDEBAR_DECK_STYLE_LARGE 100
+#define IMAGE_SIDEBAR_DECK_STYLE_LARGE_HC 101
+#define IMAGE_SIDEBAR_DECK_STYLE_SMALL 102
+#define IMAGE_SIDEBAR_DECK_STYLE_SMALL_HC 103
+#define IMAGE_SIDEBAR_DECK_TEMPLATE_LARGE 110
+#define IMAGE_SIDEBAR_DECK_TEMPLATE_LARGE_HC 111
+#define IMAGE_SIDEBAR_DECK_TEMPLATE_SMALL 112
+#define IMAGE_SIDEBAR_DECK_TEMPLATE_SMALL_HC 113
+#define IMAGE_SIDEBAR_DECK_TRANSITION_LARGE 120
+#define IMAGE_SIDEBAR_DECK_TRANSITION_LARGE_HC 121
+#define IMAGE_SIDEBAR_DECK_TRANSITION_SMALL 122
+#define IMAGE_SIDEBAR_DECK_TRANSITION_SMALL_HC 123
+#define IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE 130
+#define IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE_HC 131
+#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL 132
+#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL_HC 133
+#define STRING_CUSTOMIZATION 200
+#define STRING_RESTORE 201
-#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1)
-#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2)
-#define SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX (RID_SFX_SIDEBAR_START + 3)
+#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1)
+#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2)
+#define SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX (RID_SFX_SIDEBAR_START + 3)
diff --git a/main/sfx2/source/sidebar/TabBar.cxx b/main/sfx2/source/sidebar/TabBar.cxx
index 46398d2..63111c529 100644
--- a/main/sfx2/source/sidebar/TabBar.cxx
+++ b/main/sfx2/source/sidebar/TabBar.cxx
@@ -39,390 +39,332 @@
#include <com/sun/star/graphic/XGraphicProvider.hpp>
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-
-
-
namespace sfx2 { namespace sidebar {
TabBar::TabBar (
- Window* pParentWindow,
- const Reference<frame::XFrame>& rxFrame,
- const ::boost::function<void(const ::rtl::OUString&)>& rDeckActivationFunctor,
- const PopupMenuProvider& rPopupMenuProvider)
- : Window(pParentWindow, WB_DIALOGCONTROL),
- mxFrame(rxFrame),
- mpMenuButton(ControlFactory::CreateMenuButton(this)),
- maItems(),
- maDeckActivationFunctor(rDeckActivationFunctor),
- maPopupMenuProvider(rPopupMenuProvider)
+ Window* pParentWindow,
+ const Reference<frame::XFrame>& rxFrame,
+ const ::boost::function<void(const ::rtl::OUString&)>& rDeckActivationFunctor,
+ const PopupMenuProvider& rPopupMenuProvider)
+ : Window(pParentWindow, WB_DIALOGCONTROL),
+ mxFrame(rxFrame),
+ mpMenuButton(ControlFactory::CreateMenuButton(this)),
+ maItems(),
+ maDeckActivationFunctor(rDeckActivationFunctor),
+ maPopupMenuProvider(rPopupMenuProvider)
{
- SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
+ SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
- mpMenuButton->SetModeImage(
- Theme::GetImage(Theme::Image_TabBarMenu),
- Theme::IsHighContrastMode()
- ? BMP_COLOR_HIGHCONTRAST
- : BMP_COLOR_NORMAL);
- mpMenuButton->SetClickHdl(LINK(this, TabBar, OnToolboxClicked));
- Layout();
+ mpMenuButton->SetModeImage(
+ Theme::GetImage(Theme::Image_TabBarMenu),
+ Theme::IsHighContrastMode()
+ ? BMP_COLOR_HIGHCONTRAST
+ : BMP_COLOR_NORMAL);
+ mpMenuButton->SetClickHdl(LINK(this, TabBar, OnToolboxClicked));
+ Layout();
#ifdef DEBUG
- SetText(A2S("TabBar"));
+ SetText(A2S("TabBar"));
#endif
}
-
-
-
TabBar::~TabBar (void)
{
}
-
-
-
void TabBar::Paint (const Rectangle& rUpdateArea)
{
- Window::Paint(rUpdateArea);
+ Window::Paint(rUpdateArea);
- const sal_Int32 nHorizontalPadding (Theme::GetInteger(Theme::Int_TabMenuSeparatorPadding));
- SetLineColor(Theme::GetColor(Theme::Color_TabMenuSeparator));
- DrawLine(
- Point(nHorizontalPadding, mnMenuSeparatorY),
- Point(GetSizePixel().Width()-nHorizontalPadding, mnMenuSeparatorY));
+ const sal_Int32 nHorizontalPadding (Theme::GetInteger(Theme::Int_TabMenuSeparatorPadding));
+ SetLineColor(Theme::GetColor(Theme::Color_TabMenuSeparator));
+ DrawLine(
+ Point(nHorizontalPadding, mnMenuSeparatorY),
+ Point(GetSizePixel().Width()-nHorizontalPadding, mnMenuSeparatorY));
}
-
-
-
sal_Int32 TabBar::GetDefaultWidth (void)
{
- return Theme::GetInteger(Theme::Int_TabItemWidth)
- + Theme::GetInteger(Theme::Int_TabBarLeftPadding)
- + Theme::GetInteger(Theme::Int_TabBarRightPadding);
+ return Theme::GetInteger(Theme::Int_TabItemWidth)
+ + Theme::GetInteger(Theme::Int_TabBarLeftPadding)
+ + Theme::GetInteger(Theme::Int_TabBarRightPadding);
}
-
-
-
void TabBar::SetDecks (
- const ResourceManager::DeckContextDescriptorContainer& rDecks)
+ const ResourceManager::DeckContextDescriptorContainer& rDecks)
{
- // Remove the current buttons.
- {
- for(ItemContainer::iterator
- iItem(maItems.begin()), iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- iItem->mpButton.reset();
- }
- maItems.clear();
- }
+ // Remove the current buttons.
+ {
+ for(ItemContainer::iterator
+ iItem(maItems.begin()), iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ iItem->mpButton.reset();
+ }
+ maItems.clear();
+ }
- maItems.resize(rDecks.size());
- sal_Int32 nIndex (0);
- for (ResourceManager::DeckContextDescriptorContainer::const_iterator
- iDeck(rDecks.begin()),
- iEnd(rDecks.end());
- iDeck!=iEnd;
- ++iDeck)
- {
- const DeckDescriptor* pDescriptor = ResourceManager::Instance().GetDeckDescriptor(iDeck->msId);
- if (pDescriptor == NULL)
- {
- OSL_ASSERT(pDescriptor!=NULL);
- continue;
- }
+ maItems.resize(rDecks.size());
+ sal_Int32 nIndex (0);
+ for (ResourceManager::DeckContextDescriptorContainer::const_iterator
+ iDeck(rDecks.begin()),
+ iEnd(rDecks.end());
+ iDeck!=iEnd;
+ ++iDeck)
+ {
+ const DeckDescriptor* pDescriptor = ResourceManager::Instance().GetDeckDescriptor(iDeck->msId);
+ if (pDescriptor == NULL)
+ {
+ OSL_ASSERT(pDescriptor!=NULL);
+ continue;
+ }
- Item& rItem (maItems[nIndex++]);
- rItem.msDeckId = pDescriptor->msId;
- rItem.mpButton.reset(CreateTabItem(*pDescriptor));
- rItem.mpButton->SetClickHdl(LINK(&rItem, TabBar::Item, HandleClick));
- rItem.maDeckActivationFunctor = maDeckActivationFunctor;
- rItem.mbIsHiddenByDefault = false;
- rItem.mbIsHidden = ! pDescriptor->mbIsEnabled;
+ Item& rItem (maItems[nIndex++]);
+ rItem.msDeckId = pDescriptor->msId;
+ rItem.mpButton.reset(CreateTabItem(*pDescriptor));
+ rItem.mpButton->SetClickHdl(LINK(&rItem, TabBar::Item, HandleClick));
+ rItem.maDeckActivationFunctor = maDeckActivationFunctor;
+ rItem.mbIsHiddenByDefault = false;
+ rItem.mbIsHidden = ! pDescriptor->mbIsEnabled;
- rItem.mpButton->Enable(iDeck->mbIsEnabled);
- }
+ rItem.mpButton->Enable(iDeck->mbIsEnabled);
+ }
- UpdateButtonIcons();
- Layout();
+ UpdateButtonIcons();
+ Layout();
}
-
-
-
void TabBar::UpdateButtonIcons (void)
{
- const BmpColorMode eColorMode (
- Theme::IsHighContrastMode()
- ? BMP_COLOR_HIGHCONTRAST
- : BMP_COLOR_NORMAL);
+ const BmpColorMode eColorMode (
+ Theme::IsHighContrastMode()
+ ? BMP_COLOR_HIGHCONTRAST
+ : BMP_COLOR_NORMAL);
- mpMenuButton->SetModeImage(Theme::GetImage(Theme::Image_TabBarMenu), eColorMode);
+ mpMenuButton->SetModeImage(Theme::GetImage(Theme::Image_TabBarMenu), eColorMode);
- for(ItemContainer::const_iterator
- iItem(maItems.begin()), iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId);
- if (pDeckDescriptor != NULL)
- iItem->mpButton->SetModeImage(
- GetItemImage(*pDeckDescriptor),
- eColorMode);
- }
+ for(ItemContainer::const_iterator
+ iItem(maItems.begin()), iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId);
+ if (pDeckDescriptor != NULL)
+ iItem->mpButton->SetModeImage(
+ GetItemImage(*pDeckDescriptor),
+ eColorMode);
+ }
- Invalidate();
+ Invalidate();
}
-
-
-
void TabBar::Layout (void)
{
- const SvBorder aPadding (
- Theme::GetInteger(Theme::Int_TabBarLeftPadding),
- Theme::GetInteger(Theme::Int_TabBarTopPadding),
- Theme::GetInteger(Theme::Int_TabBarRightPadding),
- Theme::GetInteger(Theme::Int_TabBarBottomPadding));
- sal_Int32 nX (aPadding.Top());
- sal_Int32 nY (aPadding.Left());
- const Size aTabItemSize (
- Theme::GetInteger(Theme::Int_TabItemWidth),
- Theme::GetInteger(Theme::Int_TabItemHeight));
+ const SvBorder aPadding (
+ Theme::GetInteger(Theme::Int_TabBarLeftPadding),
+ Theme::GetInteger(Theme::Int_TabBarTopPadding),
+ Theme::GetInteger(Theme::Int_TabBarRightPadding),
+ Theme::GetInteger(Theme::Int_TabBarBottomPadding));
+ sal_Int32 nX (aPadding.Top());
+ sal_Int32 nY (aPadding.Left());
+ const Size aTabItemSize (
+ Theme::GetInteger(Theme::Int_TabItemWidth),
+ Theme::GetInteger(Theme::Int_TabItemHeight));
- // Place the menu button and the separator.
- if( bool(mpMenuButton))
- {
- mpMenuButton->SetPosSizePixel(
- Point(nX,nY),
- aTabItemSize);
- mpMenuButton->Show();
- nY += mpMenuButton->GetSizePixel().Height() + 1 + Theme::GetInteger(Theme::Int_TabMenuPadding);
- mnMenuSeparatorY = nY - Theme::GetInteger(Theme::Int_TabMenuPadding)/2 - 1;
- }
+ // Place the menu button and the separator.
+ if( bool(mpMenuButton))
+ {
+ mpMenuButton->SetPosSizePixel(
+ Point(nX,nY),
+ aTabItemSize);
+ mpMenuButton->Show();
+ nY += mpMenuButton->GetSizePixel().Height() + 1 + Theme::GetInteger(Theme::Int_TabMenuPadding);
+ mnMenuSeparatorY = nY - Theme::GetInteger(Theme::Int_TabMenuPadding)/2 - 1;
+ }
- // Place the deck selection buttons.
- for(ItemContainer::const_iterator
- iItem(maItems.begin()), iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- Button& rButton (*iItem->mpButton);
- rButton.Show( ! iItem->mbIsHidden);
+ // Place the deck selection buttons.
+ for(ItemContainer::const_iterator
+ iItem(maItems.begin()), iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ Button& rButton (*iItem->mpButton);
+ rButton.Show( ! iItem->mbIsHidden);
- if (iItem->mbIsHidden)
- continue;
+ if (iItem->mbIsHidden)
+ continue;
- // Place and size the icon.
- rButton.SetPosSizePixel(
- Point(nX,nY),
- aTabItemSize);
- rButton.Show();
+ // Place and size the icon.
+ rButton.SetPosSizePixel(
+ Point(nX,nY),
+ aTabItemSize);
+ rButton.Show();
- nY += rButton.GetSizePixel().Height() + 1 + aPadding.Bottom();
- }
- Invalidate();
+ nY += rButton.GetSizePixel().Height() + 1 + aPadding.Bottom();
+ }
+ Invalidate();
}
-
-
-
void TabBar::HighlightDeck (const ::rtl::OUString& rsDeckId)
{
- for (ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- if (iItem->msDeckId.equals(rsDeckId))
- iItem->mpButton->Check(sal_True);
- else
- iItem->mpButton->Check(sal_False);
- }
+ for (ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ if (iItem->msDeckId.equals(rsDeckId))
+ iItem->mpButton->Check(sal_True);
+ else
+ iItem->mpButton->Check(sal_False);
+ }
}
-
-
-
TabBar::Item* TabBar::GetItemForId (const ::rtl::OUString& rsDeckId)
{
- for (ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- if (iItem->msDeckId.equals(rsDeckId))
- return &*iItem;
- }
- return NULL;
+ for (ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ if (iItem->msDeckId.equals(rsDeckId))
+ return &*iItem;
+ }
+ return NULL;
}
-
-
-
void TabBar::DataChanged (const DataChangedEvent& rDataChangedEvent)
{
- SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
- UpdateButtonIcons();
+ SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
+ UpdateButtonIcons();
- Window::DataChanged(rDataChangedEvent);
+ Window::DataChanged(rDataChangedEvent);
}
-
-
-
long TabBar::Notify (NotifyEvent&)
{
- return sal_False;
+ return sal_False;
}
-
-
-
RadioButton* TabBar::CreateTabItem (const DeckDescriptor& rDeckDescriptor)
{
- RadioButton* pItem = ControlFactory::CreateTabItem(this);
- pItem->SetHelpText(rDeckDescriptor.msHelpText);
- pItem->SetQuickHelpText(rDeckDescriptor.msHelpText);
+ RadioButton* pItem = ControlFactory::CreateTabItem(this);
+ pItem->SetHelpText(rDeckDescriptor.msHelpText);
+ pItem->SetQuickHelpText(rDeckDescriptor.msHelpText);
- return pItem;
+ return pItem;
}
-
-
Image TabBar::GetItemImage (const DeckDescriptor& rDeckDescriptor) const
{
- return Tools::GetImage(
- rDeckDescriptor.msIconURL,
- rDeckDescriptor.msHighContrastIconURL,
- mxFrame);
+ return Tools::GetImage(
+ rDeckDescriptor.msIconURL,
+ rDeckDescriptor.msHighContrastIconURL,
+ mxFrame);
}
-
-
-
-
IMPL_LINK(TabBar::Item, HandleClick, Button*, EMPTYARG)
{
- try
- {
- maDeckActivationFunctor(msDeckId);
- }
- catch( const ::com::sun::star::uno::Exception&) {} // workaround for #i123198#
+ try
+ {
+ maDeckActivationFunctor(msDeckId);
+ }
+ catch( const ::com::sun::star::uno::Exception&) {} // workaround for #i123198#
- return 1;
+ return 1;
}
-
-
-
const ::rtl::OUString TabBar::GetDeckIdForIndex (const sal_Int32 nIndex) const
{
- if (nIndex<0 || static_cast<size_t>(nIndex)>=maItems.size())
- throw RuntimeException();
- else
- return maItems[nIndex].msDeckId;
+ if (nIndex<0 || static_cast<size_t>(nIndex)>=maItems.size())
+ throw RuntimeException();
+ else
+ return maItems[nIndex].msDeckId;
}
-
-
-
void TabBar::ToggleHideFlag (const sal_Int32 nIndex)
{
- if (nIndex<0 || static_cast<size_t>(nIndex)>=maItems.size())
- throw RuntimeException();
- else
- {
- maItems[nIndex].mbIsHidden = ! maItems[nIndex].mbIsHidden;
- ResourceManager::Instance().SetIsDeckEnabled(
- maItems[nIndex].msDeckId,
- maItems[nIndex].mbIsHidden);
- Layout();
- }
+ if (nIndex<0 || static_cast<size_t>(nIndex)>=maItems.size())
+ throw RuntimeException();
+ else
+ {
+ maItems[nIndex].mbIsHidden = ! maItems[nIndex].mbIsHidden;
+ ResourceManager::Instance().SetIsDeckEnabled(
+ maItems[nIndex].msDeckId,
+ maItems[nIndex].mbIsHidden);
+ Layout();
+ }
}
-
-
-
void TabBar::RestoreHideFlags (void)
{
- bool bNeedsLayout (false);
- for(ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- if (iItem->mbIsHidden != iItem->mbIsHiddenByDefault)
- {
- iItem->mbIsHidden = iItem->mbIsHiddenByDefault;
- bNeedsLayout = true;
- }
- }
- if (bNeedsLayout)
- Layout();
+ bool bNeedsLayout (false);
+ for(ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ if (iItem->mbIsHidden != iItem->mbIsHiddenByDefault)
+ {
+ iItem->mbIsHidden = iItem->mbIsHiddenByDefault;
+ bNeedsLayout = true;
+ }
+ }
+ if (bNeedsLayout)
+ Layout();
}
-
-
-
void TabBar::UpdateFocusManager (FocusManager& rFocusManager)
{
- ::std::vector<Button*> aButtons;
- aButtons.reserve(maItems.size()+1);
+ ::std::vector<Button*> aButtons;
+ aButtons.reserve(maItems.size()+1);
- aButtons.push_back(mpMenuButton.get());
- for(ItemContainer::const_iterator
- iItem(maItems.begin()), iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- aButtons.push_back(iItem->mpButton.get());
- }
- rFocusManager.SetButtons(aButtons);
+ aButtons.push_back(mpMenuButton.get());
+ for(ItemContainer::const_iterator
+ iItem(maItems.begin()), iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ aButtons.push_back(iItem->mpButton.get());
+ }
+ rFocusManager.SetButtons(aButtons);
}
-
-
-
IMPL_LINK(TabBar, OnToolboxClicked, void*, EMPTYARG)
{
- if ( ! mpMenuButton)
- return 0;
+ if ( ! mpMenuButton)
+ return 0;
- ::std::vector<DeckMenuData> aMenuData;
+ ::std::vector<DeckMenuData> aMenuData;
- for(ItemContainer::const_iterator iItem(maItems.begin()),iEnd(maItems.end());
- iItem!=iEnd;
- ++iItem)
- {
- const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId);
- if (pDeckDescriptor != NULL)
- {
- DeckMenuData aData;
- aData.msDisplayName = pDeckDescriptor->msTitle;
- aData.msDeckId = pDeckDescriptor->msId;
- aData.mbIsCurrentDeck = iItem->mpButton->IsChecked();
- aData.mbIsActive = !iItem->mbIsHidden;
- aData.mbIsEnabled = iItem->mpButton->IsEnabled();
+ for(ItemContainer::const_iterator iItem(maItems.begin()),iEnd(maItems.end());
+ iItem!=iEnd;
+ ++iItem)
+ {
+ const DeckDescriptor* pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(iItem->msDeckId);
+ if (pDeckDescriptor != NULL)
+ {
+ DeckMenuData aData;
+ aData.msDisplayName = pDeckDescriptor->msTitle;
+ aData.msDeckId = pDeckDescriptor->msId;
+ aData.mbIsCurrentDeck = iItem->mpButton->IsChecked();
+ aData.mbIsActive = !iItem->mbIsHidden;
+ aData.mbIsEnabled = iItem->mpButton->IsEnabled();
- aMenuData.push_back(aData);
- }
- }
+ aMenuData.push_back(aData);
+ }
+ }
- maPopupMenuProvider(
- Rectangle(
- mpMenuButton->GetPosPixel(),
- mpMenuButton->GetSizePixel()),
- aMenuData);
- mpMenuButton->Check(sal_False);
+ maPopupMenuProvider(
+ Rectangle(
+ mpMenuButton->GetPosPixel(),
+ mpMenuButton->GetSizePixel()),
+ aMenuData);
+ mpMenuButton->Check(sal_False);
- return 0;
+ return 0;
}
-
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/Theme.cxx b/main/sfx2/source/sidebar/Theme.cxx
index d179a9b..733ed85 100644
--- a/main/sfx2/source/sidebar/Theme.cxx
+++ b/main/sfx2/source/sidebar/Theme.cxx
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#include "precompiled_sfx2.hxx"
#include "sfx2/sidebar/Theme.hxx"
@@ -35,12 +33,10 @@
using namespace css;
using namespace cssu;
-
namespace sfx2 { namespace sidebar {
::rtl::Reference<Theme> Theme::mpInstance;
-
Theme& Theme::GetCurrentTheme (void)
{
if ( ! mpInstance.is())
@@ -51,7 +47,6 @@
return *mpInstance;
}
-
Theme::Theme (void)
: ThemeInterfaceBase(m_aMutex),
maImages(),
@@ -71,12 +66,10 @@
SetupPropertyMaps();
}
-
Theme::~Theme (void)
{
}
-
Image Theme::GetImage (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
@@ -86,7 +79,6 @@
return rTheme.maImages[nIndex];
}
-
Color Theme::GetColor (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
@@ -101,7 +93,6 @@
return COL_WHITE;
}
-
const Paint& Theme::GetPaint (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
@@ -111,13 +102,11 @@
return rTheme.maPaints[nIndex];
}
-
const Wallpaper Theme::GetWallpaper (const ThemeItem eItem)
{
return GetPaint(eItem).GetWallpaper();
}
-
sal_Int32 Theme::GetInteger (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
@@ -127,7 +116,6 @@
return rTheme.maIntegers[nIndex];
}
-
bool Theme::GetBoolean (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
@@ -137,7 +125,6 @@
return rTheme.maBooleans[nIndex];
}
-
Rectangle Theme::GetRectangle (const ThemeItem eItem)
{
const PropertyType eType (GetPropertyType(eItem));
@@ -147,14 +134,12 @@
return rTheme.maRectangles[nIndex];
}
-
bool Theme::IsHighContrastMode (void)
{
const Theme& rTheme (GetCurrentTheme());
return rTheme.mbIsHighContrastMode;
}
-
void Theme::HandleDataChange (void)
{
Theme& rTheme (GetCurrentTheme());
@@ -169,7 +154,6 @@
GetCurrentTheme().UpdateTheme();
}
-
void Theme::InitializeTheme (void)
{
setPropertyValue(
@@ -180,7 +164,6 @@
Any(false));
}
-
void Theme::UpdateTheme (void)
{
SidebarResource aLocalResource;
@@ -447,7 +430,6 @@
}
}
-
void SAL_CALL Theme::disposing (void)
{
ChangeListeners aListeners;
@@ -478,20 +460,17 @@
}
}
-
Reference<beans::XPropertySet> Theme::GetPropertySet (void)
{
return Reference<beans::XPropertySet>(static_cast<XWeak*>(&GetCurrentTheme()), UNO_QUERY);
}
-
Reference<beans::XPropertySetInfo> SAL_CALL Theme::getPropertySetInfo (void)
throw(cssu::RuntimeException)
{
return Reference<beans::XPropertySetInfo>(this);
}
-
void SAL_CALL Theme::setPropertyValue (
const ::rtl::OUString& rsPropertyName,
const cssu::Any& rValue)
@@ -536,7 +515,6 @@
BroadcastPropertyChange(GetChangeListeners(eItem, false), aEvent);
}
-
Any SAL_CALL Theme::getPropertyValue (
const ::rtl::OUString& rsPropertyName)
throw(css::beans::UnknownPropertyException,
@@ -556,7 +534,6 @@
return maRawValues[eItem];
}
-
void SAL_CALL Theme::addPropertyChangeListener(
const ::rtl::OUString& rsPropertyName,
const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener)
@@ -582,7 +559,6 @@
pListeners->push_back(rxListener);
}
-
void SAL_CALL Theme::removePropertyChangeListener(
const ::rtl::OUString& rsPropertyName,
const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener)
@@ -618,7 +594,6 @@
}
}
-
void SAL_CALL Theme::addVetoableChangeListener(
const ::rtl::OUString& rsPropertyName,
const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener)
@@ -644,7 +619,6 @@
pListeners->push_back(rxListener);
}
-
void SAL_CALL Theme::removeVetoableChangeListener(
const ::rtl::OUString& rsPropertyName,
const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener)
@@ -679,7 +653,6 @@
}
}
-
cssu::Sequence<css::beans::Property> SAL_CALL Theme::getProperties (void)
throw(cssu::RuntimeException)
{
@@ -705,7 +678,6 @@
aProperties.size());
}
-
beans::Property SAL_CALL Theme::getPropertyByName (const ::rtl::OUString& rsPropertyName)
throw(css::beans::UnknownPropertyException,
cssu::RuntimeException)
@@ -727,7 +699,6 @@
0);
}
-
sal_Bool SAL_CALL Theme::hasPropertyByName (const ::rtl::OUString& rsPropertyName)
throw(cssu::RuntimeException)
{
@@ -742,7 +713,6 @@
return sal_True;
}
-
void Theme::SetupPropertyMaps (void)
{
maPropertyIdToNameMap.resize(__Post_Rect);
@@ -818,7 +788,6 @@
maRawValues.resize(maPropertyIdToNameMap.size());
}
-
Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem)
{
switch(eItem)
@@ -892,7 +861,6 @@
}
}
-
cssu::Type Theme::GetCppuType (const PropertyType eType)
{
switch(eType)
@@ -921,7 +889,6 @@
}
}
-
sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType)
{
switch(eType)
@@ -945,7 +912,6 @@
}
}
-
Theme::VetoableListenerContainer* Theme::GetVetoableListeners (
const ThemeItem eItem,
const bool bCreate)
@@ -962,7 +928,6 @@
return NULL;
}
-
Theme::ChangeListenerContainer* Theme::GetChangeListeners (
const ThemeItem eItem,
const bool bCreate)
@@ -979,7 +944,6 @@
return NULL;
}
-
bool Theme::DoVetoableListenersVeto (
const VetoableListenerContainer* pListeners,
const beans::PropertyChangeEvent& rEvent) const
@@ -1010,7 +974,6 @@
return false;
}
-
void Theme::BroadcastPropertyChange (
const ChangeListenerContainer* pListeners,
const beans::PropertyChangeEvent& rEvent) const
@@ -1036,7 +999,6 @@
}
}
-
void Theme::ProcessNewValue (
const Any& rValue,
const ThemeItem eItem,
diff --git a/main/sfx2/source/sidebar/TitleBar.cxx b/main/sfx2/source/sidebar/TitleBar.cxx
index c2e01bf..2a71dfe 100644
--- a/main/sfx2/source/sidebar/TitleBar.cxx
+++ b/main/sfx2/source/sidebar/TitleBar.cxx
@@ -32,217 +32,178 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-
ToolbarValue::~ToolbarValue (void) {}
namespace
{
- const static sal_Int32 gnLeftIconSpace (3);
- const static sal_Int32 gnRightIconSpace (3);
+ const static sal_Int32 gnLeftIconSpace (3);
+ const static sal_Int32 gnRightIconSpace (3);
}
namespace sfx2 { namespace sidebar {
TitleBar::TitleBar (
- const ::rtl::OUString& rsTitle,
- Window* pParentWindow,
- const sidebar::Paint& rInitialBackgroundPaint)
- : Window(pParentWindow),
- maToolBox(this),
- msTitle(rsTitle),
- maIcon()
+ const ::rtl::OUString& rsTitle,
+ Window* pParentWindow,
+ const sidebar::Paint& rInitialBackgroundPaint)
+ : Window(pParentWindow),
+ maToolBox(this),
+ msTitle(rsTitle),
+ maIcon()
{
- SetBackground(rInitialBackgroundPaint.GetWallpaper());
+ SetBackground(rInitialBackgroundPaint.GetWallpaper());
- maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
+ maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
}
-
-
-
TitleBar::~TitleBar (void)
{
}
-
-
-
void TitleBar::SetTitle (const ::rtl::OUString& rsTitle)
{
- msTitle = rsTitle;
- Invalidate();
+ msTitle = rsTitle;
+ Invalidate();
}
-
-
-
void TitleBar::SetIcon (const Image& rIcon)
{
- maIcon = rIcon;
- Invalidate();
+ maIcon = rIcon;
+ Invalidate();
}
-
-
-
void TitleBar::Paint (const Rectangle& rUpdateArea)
{
- (void)rUpdateArea;
+ (void)rUpdateArea;
- // Paint title bar background.
- Size aWindowSize (GetOutputSizePixel());
- Rectangle aTitleBarBox(
- 0,
- 0,
- aWindowSize.Width(),
- aWindowSize.Height()
- );
+ // Paint title bar background.
+ Size aWindowSize (GetOutputSizePixel());
+ Rectangle aTitleBarBox(
+ 0,
+ 0,
+ aWindowSize.Width(),
+ aWindowSize.Height()
+ );
- PaintDecoration(aTitleBarBox);
- const Rectangle aTitleBox (GetTitleArea(aTitleBarBox));
- PaintTitle(aTitleBox);
- PaintFocus(aTitleBox);
+ PaintDecoration(aTitleBarBox);
+ const Rectangle aTitleBox (GetTitleArea(aTitleBarBox));
+ PaintTitle(aTitleBox);
+ PaintFocus(aTitleBox);
}
-
-
-
void TitleBar::DataChanged (const DataChangedEvent& rEvent)
{
- (void)rEvent;
+ (void)rEvent;
- SetBackground(GetBackgroundPaint().GetWallpaper());
+ SetBackground(GetBackgroundPaint().GetWallpaper());
}
-
-
-
void TitleBar::SetPosSizePixel (
- long nX,
- long nY,
- long nWidth,
- long nHeight,
- sal_uInt16 nFlags)
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight,
+ sal_uInt16 nFlags)
{
- Window::SetPosSizePixel(nX,nY,nWidth,nHeight,nFlags);
+ Window::SetPosSizePixel(nX,nY,nWidth,nHeight,nFlags);
- // Place the toolbox.
- const sal_Int32 nToolBoxWidth (maToolBox.GetItemPosRect(0).GetWidth());
- maToolBox.SetPosSizePixel(nWidth-nToolBoxWidth,0, nToolBoxWidth,nHeight, WINDOW_POSSIZE_POSSIZE);
- maToolBox.Show();
+ // Place the toolbox.
+ const sal_Int32 nToolBoxWidth (maToolBox.GetItemPosRect(0).GetWidth());
+ maToolBox.SetPosSizePixel(nWidth-nToolBoxWidth,0, nToolBoxWidth,nHeight, WINDOW_POSSIZE_POSSIZE);
+ maToolBox.Show();
}
-
-
-
ToolBox& TitleBar::GetToolBox (void)
{
- return maToolBox;
+ return maToolBox;
}
-
-
-
const ToolBox& TitleBar::GetToolBox (void) const
{
- return maToolBox;
+ return maToolBox;
}
-
-
-
void TitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex)
{
- (void)nItemIndex;
- // Any real processing has to be done in derived class.
+ (void)nItemIndex;
+ // Any real processing has to be done in derived class.
}
-
-
-
cssu::Reference<css::accessibility::XAccessible> TitleBar::CreateAccessible (void)
{
- SetAccessibleRole(css::accessibility::AccessibleRole::PANEL);
- return AccessibleTitleBar::Create(*this);
+ SetAccessibleRole(css::accessibility::AccessibleRole::PANEL);
+ return AccessibleTitleBar::Create(*this);
}
-
-
-
void TitleBar::PaintTitle (const Rectangle& rTitleBox)
{
- Push(PUSH_FONT | PUSH_TEXTCOLOR);
+ Push(PUSH_FONT | PUSH_TEXTCOLOR);
- Rectangle aTitleBox (rTitleBox);
+ Rectangle aTitleBox (rTitleBox);
- // When there is an icon then paint it at the left of the given
- // box.
- if ( !! maIcon)
- {
- DrawImage(
- Point(
- aTitleBox.Left() + gnLeftIconSpace,
- aTitleBox.Top() + (aTitleBox.GetHeight()-maIcon.GetSizePixel().Height())/2),
- maIcon);
- aTitleBox.Left() += gnLeftIconSpace + maIcon.GetSizePixel().Width() + gnRightIconSpace;
- }
+ // When there is an icon then paint it at the left of the given box.
+ if ( !! maIcon)
+ {
+ DrawImage(
+ Point(
+ aTitleBox.Left() + gnLeftIconSpace,
+ aTitleBox.Top() + (aTitleBox.GetHeight()-maIcon.GetSizePixel().Height())/2),
+ maIcon);
+ aTitleBox.Left() += gnLeftIconSpace + maIcon.GetSizePixel().Width() + gnRightIconSpace;
+ }
- Font aFont(GetFont());
- aFont.SetWeight(WEIGHT_BOLD);
- SetFont(aFont);
+ Font aFont(GetFont());
+ aFont.SetWeight(WEIGHT_BOLD);
+ SetFont(aFont);
- // Paint title bar text.
- SetTextColor(GetTextColor());
- DrawText(
- aTitleBox,
- msTitle,
- TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER);
+ // Paint title bar text.
+ SetTextColor(GetTextColor());
+ DrawText(
+ aTitleBox,
+ msTitle,
+ TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER);
- Pop();
+ Pop();
}
-
-
-
void TitleBar::PaintFocus (const Rectangle& rFocusBox)
{
- Push(PUSH_FONT | PUSH_TEXTCOLOR);
+ Push(PUSH_FONT | PUSH_TEXTCOLOR);
- Font aFont(GetFont());
- aFont.SetWeight(WEIGHT_BOLD);
- SetFont(aFont);
+ Font aFont(GetFont());
+ aFont.SetWeight(WEIGHT_BOLD);
+ SetFont(aFont);
- const Rectangle aTextBox (
- GetTextRect(
- rFocusBox,
- msTitle,
- TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER));
- const Rectangle aLargerTextBox (
- aTextBox.Left() - 2,
- aTextBox.Top() - 2,
- aTextBox.Right() + 2,
- aTextBox.Bottom() + 2);
+ const Rectangle aTextBox (
+ GetTextRect(
+ rFocusBox,
+ msTitle,
+ TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER));
+ const Rectangle aLargerTextBox (
+ aTextBox.Left() - 2,
+ aTextBox.Top() - 2,
+ aTextBox.Right() + 2,
+ aTextBox.Bottom() + 2);
- if (HasFocus())
- Window::ShowFocus(aLargerTextBox);
- else
- Window::HideFocus();
+ if (HasFocus())
+ Window::ShowFocus(aLargerTextBox);
+ else
+ Window::HideFocus();
- Pop();
+ Pop();
}
-
-
-
IMPL_LINK(TitleBar, SelectionHandler, ToolBox*, pToolBox)
{
- (void)pToolBox;
- OSL_ASSERT(&maToolBox==pToolBox);
- const sal_uInt16 nItemId (maToolBox.GetHighlightItemId());
+ (void)pToolBox;
+ OSL_ASSERT(&maToolBox==pToolBox);
+ const sal_uInt16 nItemId (maToolBox.GetHighlightItemId());
- HandleToolBoxItemClick(nItemId);
+ HandleToolBoxItemClick(nItemId);
- return sal_True;
+ return sal_True;
}
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/ToolBoxBackground.cxx b/main/sfx2/source/sidebar/ToolBoxBackground.cxx
index 46d8d88..433531f 100644
--- a/main/sfx2/source/sidebar/ToolBoxBackground.cxx
+++ b/main/sfx2/source/sidebar/ToolBoxBackground.cxx
@@ -31,127 +31,112 @@
#include <vcl/gradient.hxx>
#include <svl/smplhint.hxx>
-
namespace sfx2 { namespace sidebar {
ToolBoxBackground::ToolBoxBackground (
- Window* pParentWindow,
- const bool bShowBorder)
- : Window(pParentWindow, WB_DIALOGCONTROL),
- maPadding(bShowBorder
- ? Tools::RectangleToSvBorder(Theme::GetRectangle(Theme::Rect_ToolBoxPadding))
- : SvBorder())
+ Window* pParentWindow,
+ const bool bShowBorder)
+ : Window(pParentWindow, WB_DIALOGCONTROL),
+ maPadding(bShowBorder
+ ? Tools::RectangleToSvBorder(Theme::GetRectangle(Theme::Rect_ToolBoxPadding))
+ : SvBorder())
{
- if (bShowBorder)
- SetBackground(Theme::GetPaint(Theme::Paint_ToolBoxBackground).GetWallpaper());
- else
- SetBackground(Wallpaper());
+ if (bShowBorder)
+ SetBackground(Theme::GetPaint(Theme::Paint_ToolBoxBackground).GetWallpaper());
+ else
+ SetBackground(Wallpaper());
#ifdef DEBUG
- SetText(A2S("ToolBoxBackground"));
+ SetText(A2S("ToolBoxBackground"));
#endif
}
-
-
-
ToolBoxBackground::~ToolBoxBackground (void)
{
- Link aEventListener (LINK(this, ToolBoxBackground, WindowEventHandler));
- if (GetChildCount() > 0)
- GetChild(0)->RemoveEventListener(aEventListener);
+ Link aEventListener (LINK(this, ToolBoxBackground, WindowEventHandler));
+ if (GetChildCount() > 0)
+ GetChild(0)->RemoveEventListener(aEventListener);
}
-
-
-
Point ToolBoxBackground::SetToolBoxChild (
- ToolBox* pChild,
- long nX,
- long nY,
- long nWidth,
- long nHeight,
- sal_uInt16 nFlags)
+ ToolBox* pChild,
+ long nX,
+ long nY,
+ long nWidth,
+ long nHeight,
+ sal_uInt16 nFlags)
{
- if (pChild == NULL)
- {
- OSL_ASSERT(pChild!=NULL);
- return Point(nX, nY);
- }
+ if (pChild == NULL)
+ {
+ OSL_ASSERT(pChild!=NULL);
+ return Point(nX, nY);
+ }
- Link aEventListener (LINK(this, ToolBoxBackground, WindowEventHandler));
- pChild->AddEventListener(aEventListener);
+ Link aEventListener (LINK(this, ToolBoxBackground, WindowEventHandler));
+ pChild->AddEventListener(aEventListener);
- SetPosSizePixel(
- nX - maPadding.Left(),
- nY - maPadding.Top(),
- nWidth + maPadding.Left() + maPadding.Right(),
- nHeight + maPadding.Top() + maPadding.Bottom(),
- nFlags);
- return Point(
- maPadding.Left(),
- maPadding.Top());
+ SetPosSizePixel(
+ nX - maPadding.Left(),
+ nY - maPadding.Top(),
+ nWidth + maPadding.Left() + maPadding.Right(),
+ nHeight + maPadding.Top() + maPadding.Bottom(),
+ nFlags);
+ return Point(
+ maPadding.Left(),
+ maPadding.Top());
}
-
-
-
void ToolBoxBackground::Paint (const Rectangle& rRect)
{
- Window::Paint(rRect);
+ Window::Paint(rRect);
- Rectangle aBox (Point(0,0), GetSizePixel());
+ Rectangle aBox (Point(0,0), GetSizePixel());
- const sidebar::Paint aTopLeftBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderTopLeft));
- const sidebar::Paint aCenterBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderCenterCorners));
- const sidebar::Paint aBottomRightBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderBottomRight));
- const Rectangle aBorderSize (Theme::GetRectangle(Theme::Rect_ToolBoxBorder));
- DrawHelper::DrawBevelBorder (
- *this,
- aBox,
- Tools::RectangleToSvBorder(aBorderSize),
- aTopLeftBorderPaint,
- aCenterBorderPaint,
- aBottomRightBorderPaint);
+ const sidebar::Paint aTopLeftBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderTopLeft));
+ const sidebar::Paint aCenterBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderCenterCorners));
+ const sidebar::Paint aBottomRightBorderPaint (Theme::GetPaint(Theme::Paint_ToolBoxBorderBottomRight));
+ const Rectangle aBorderSize (Theme::GetRectangle(Theme::Rect_ToolBoxBorder));
+ DrawHelper::DrawBevelBorder (
+ *this,
+ aBox,
+ Tools::RectangleToSvBorder(aBorderSize),
+ aTopLeftBorderPaint,
+ aCenterBorderPaint,
+ aBottomRightBorderPaint);
}
-
-
-
void ToolBoxBackground::DataChanged (const DataChangedEvent& rEvent)
{
- (void)rEvent;
+ (void)rEvent;
- SetBackground(Theme::GetPaint(Theme::Paint_ToolBoxBackground).GetWallpaper());
- maPadding = Tools::RectangleToSvBorder(Theme::GetRectangle(Theme::Rect_ToolBoxPadding));
+ SetBackground(Theme::GetPaint(Theme::Paint_ToolBoxBackground).GetWallpaper());
+ maPadding = Tools::RectangleToSvBorder(Theme::GetRectangle(Theme::Rect_ToolBoxPadding));
}
-
-
-
IMPL_LINK(ToolBoxBackground, WindowEventHandler, VclWindowEvent*, pEvent)
{
- if (pEvent != NULL)
- {
- switch (pEvent->GetId())
- {
- case VCLEVENT_WINDOW_SHOW:
- if (GetChild(0)->IsVisible())
- Show();
- break;
+ if (pEvent != NULL)
+ {
+ switch (pEvent->GetId())
+ {
+ case VCLEVENT_WINDOW_SHOW:
+ if (GetChild(0)->IsVisible())
+ Show();
+ break;
- case VCLEVENT_WINDOW_HIDE:
- if ( ! GetChild(0)->IsVisible())
- Hide();
- break;
+ case VCLEVENT_WINDOW_HIDE:
+ if ( ! GetChild(0)->IsVisible())
+ Hide();
+ break;
- default:
- break;
- }
- }
+ default:
+ break;
+ }
+ }
- return sal_True;
+ return sal_True;
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sfx2/source/sidebar/Tools.cxx b/main/sfx2/source/sidebar/Tools.cxx
index 9a7d6fa..05b668f 100644
--- a/main/sfx2/source/sidebar/Tools.cxx
+++ b/main/sfx2/source/sidebar/Tools.cxx
@@ -41,173 +41,152 @@
using namespace css;
using namespace cssu;
-
namespace sfx2 { namespace sidebar {
Image Tools::GetImage (
- const ::rtl::OUString& rsImageURL,
- const ::rtl::OUString& rsHighContrastImageURL,
- const Reference<frame::XFrame>& rxFrame)
+ const ::rtl::OUString& rsImageURL,
+ const ::rtl::OUString& rsHighContrastImageURL,
+ const Reference<frame::XFrame>& rxFrame)
{
- if (Theme::IsHighContrastMode())
- return GetImage(rsHighContrastImageURL, rxFrame);
- else
- return GetImage(rsImageURL, rxFrame);
+ if (Theme::IsHighContrastMode())
+ return GetImage(rsHighContrastImageURL, rxFrame);
+ else
+ return GetImage(rsImageURL, rxFrame);
}
-
-
-
Image Tools::GetImage (
- const ::rtl::OUString& rsURL,
- const Reference<frame::XFrame>& rxFrame)
+ const ::rtl::OUString& rsURL,
+ const Reference<frame::XFrame>& rxFrame)
{
- if (rsURL.getLength() > 0)
- {
- static const sal_Char* sUnoCommandPrefix = ".uno:";
- static const sal_Int32 nUnoCommandPrefixLength = strlen(sUnoCommandPrefix);
- static const sal_Char* sCommandImagePrefix = "private:commandimage/";
- static const sal_Int32 nCommandImagePrefixLength = strlen(sCommandImagePrefix);
+ if (rsURL.getLength() > 0)
+ {
+ static const sal_Char* sUnoCommandPrefix = ".uno:";
+ static const sal_Int32 nUnoCommandPrefixLength = strlen(sUnoCommandPrefix);
+ static const sal_Char* sCommandImagePrefix = "private:commandimage/";
+ static const sal_Int32 nCommandImagePrefixLength = strlen(sCommandImagePrefix);
- if (rsURL.compareToAscii(sUnoCommandPrefix, nUnoCommandPrefixLength) == 0)
- {
- const Image aPanelImage (::GetImage(rxFrame, rsURL, sal_False, Theme::IsHighContrastMode()));
- return aPanelImage;
- }
- else if (rsURL.compareToAscii(sCommandImagePrefix, nCommandImagePrefixLength) == 0)
- {
- ::rtl::OUStringBuffer aCommandName;
- aCommandName.appendAscii(sUnoCommandPrefix);
- aCommandName.append(rsURL.copy(nCommandImagePrefixLength));
- const ::rtl::OUString sCommandName (aCommandName.makeStringAndClear());
+ if (rsURL.compareToAscii(sUnoCommandPrefix, nUnoCommandPrefixLength) == 0)
+ {
+ const Image aPanelImage (::GetImage(rxFrame, rsURL, sal_False, Theme::IsHighContrastMode()));
+ return aPanelImage;
+ }
+ else if (rsURL.compareToAscii(sCommandImagePrefix, nCommandImagePrefixLength) == 0)
+ {
+ ::rtl::OUStringBuffer aCommandName;
+ aCommandName.appendAscii(sUnoCommandPrefix);
+ aCommandName.append(rsURL.copy(nCommandImagePrefixLength));
+ const ::rtl::OUString sCommandName (aCommandName.makeStringAndClear());
- const Image aPanelImage (::GetImage(rxFrame, sCommandName, sal_False, Theme::IsHighContrastMode()));
- return aPanelImage;
- }
- else
- {
- const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
- const Reference<graphic::XGraphicProvider> xGraphicProvider (
- aContext.createComponent("com.sun.star.graphic.GraphicProvider"),
- UNO_QUERY);
- if ( xGraphicProvider.is())
- {
- ::comphelper::NamedValueCollection aMediaProperties;
- aMediaProperties.put("URL", rsURL);
- const Reference<graphic::XGraphic> xGraphic (
- xGraphicProvider->queryGraphic(aMediaProperties.getPropertyValues()),
- UNO_QUERY);
- if (xGraphic.is())
- return Image(xGraphic);
- }
- }
- }
- return Image();
+ const Image aPanelImage (::GetImage(rxFrame, sCommandName, sal_False, Theme::IsHighContrastMode()));
+ return aPanelImage;
+ }
+ else
+ {
+ const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
+ const Reference<graphic::XGraphicProvider> xGraphicProvider (
+ aContext.createComponent("com.sun.star.graphic.GraphicProvider"),
+ UNO_QUERY);
+ if ( xGraphicProvider.is())
+ {
+ ::comphelper::NamedValueCollection aMediaProperties;
+ aMediaProperties.put("URL", rsURL);
+ const Reference<graphic::XGraphic> xGraphic (
+ xGraphicProvider->queryGraphic(aMediaProperties.getPropertyValues()),
+ UNO_QUERY);
+ if (xGraphic.is())
+ return Image(xGraphic);
+ }
+ }
+ }
+ return Image();
}
-
-
-
css::awt::Gradient Tools::VclToAwtGradient (const Gradient aVclGradient)
{
- css::awt::Gradient aAwtGradient (
- awt::GradientStyle(aVclGradient.GetStyle()),
- aVclGradient.GetStartColor().GetRGBColor(),
- aVclGradient.GetEndColor().GetRGBColor(),
- aVclGradient.GetAngle(),
- aVclGradient.GetBorder(),
- aVclGradient.GetOfsX(),
- aVclGradient.GetOfsY(),
- aVclGradient.GetStartIntensity(),
- aVclGradient.GetEndIntensity(),
- aVclGradient.GetSteps());
- return aAwtGradient;
+ css::awt::Gradient aAwtGradient (
+ awt::GradientStyle(aVclGradient.GetStyle()),
+ aVclGradient.GetStartColor().GetRGBColor(),
+ aVclGradient.GetEndColor().GetRGBColor(),
+ aVclGradient.GetAngle(),
+ aVclGradient.GetBorder(),
+ aVclGradient.GetOfsX(),
+ aVclGradient.GetOfsY(),
+ aVclGradient.GetStartIntensity(),
+ aVclGradient.GetEndIntensity(),
+ aVclGradient.GetSteps());
+ return aAwtGradient;
}
-
-
-
Gradient Tools::AwtToVclGradient (const css::awt::Gradient aAwtGradient)
{
- Gradient aVclGradient (
- GradientStyle(aAwtGradient.Style),
- aAwtGradient.StartColor,
- aAwtGradient.EndColor);
- aVclGradient.SetAngle(aAwtGradient.Angle);
- aVclGradient.SetBorder(aAwtGradient.Border);
- aVclGradient.SetOfsX(aAwtGradient.XOffset);
- aVclGradient.SetOfsY(aAwtGradient.YOffset);
- aVclGradient.SetStartIntensity(aAwtGradient.StartIntensity);
- aVclGradient.SetEndIntensity(aAwtGradient.EndIntensity);
- aVclGradient.SetSteps(aAwtGradient.StepCount);
+ Gradient aVclGradient (
+ GradientStyle(aAwtGradient.Style),
+ aAwtGradient.StartColor,
+ aAwtGradient.EndColor);
+ aVclGradient.SetAngle(aAwtGradient.Angle);
+ aVclGradient.SetBorder(aAwtGradient.Border);
+ aVclGradient.SetOfsX(aAwtGradient.XOffset);
+ aVclGradient.SetOfsY(aAwtGradient.YOffset);
+ aVclGradient.SetStartIntensity(aAwtGradient.StartIntensity);
+ aVclGradient.SetEndIntensity(aAwtGradient.EndIntensity);
+ aVclGradient.SetSteps(aAwtGradient.StepCount);
- return aVclGradient;
+ return aVclGradient;
}
-
-
-
SvBorder Tools::RectangleToSvBorder (const Rectangle aBox)
{
- return SvBorder(
- aBox.Left(),
- aBox.Top(),
- aBox.Right(),
- aBox.Bottom());
+ return SvBorder(
+ aBox.Left(),
+ aBox.Top(),
+ aBox.Right(),
+ aBox.Bottom());
}
-
-
-
util::URL Tools::GetURL (const ::rtl::OUString& rsCommand)
{
- util::URL aURL;
- aURL.Complete = rsCommand;
+ util::URL aURL;
+ aURL.Complete = rsCommand;
- const ::comphelper::ComponentContext aComponentContext (::comphelper::getProcessServiceFactory());
- const Reference<util::XURLTransformer> xParser (
- aComponentContext.createComponent("com.sun.star.util.URLTransformer"),
- UNO_QUERY_THROW);
- xParser->parseStrict(aURL);
+ const ::comphelper::ComponentContext aComponentContext (::comphelper::getProcessServiceFactory());
+ const Reference<util::XURLTransformer> xParser (
+ aComponentContext.createComponent("com.sun.star.util.URLTransformer"),
+ UNO_QUERY_THROW);
+ xParser->parseStrict(aURL);
- return aURL;
+ return aURL;
}
-
-
-
Reference<frame::XDispatch> Tools::GetDispatch (
- const cssu::Reference<css::frame::XFrame>& rxFrame,
- const util::URL& rURL)
+ const cssu::Reference<css::frame::XFrame>& rxFrame,
+ const util::URL& rURL)
{
- Reference<frame::XDispatchProvider> xProvider (rxFrame, UNO_QUERY_THROW);
- Reference<frame::XDispatch> xDispatch (xProvider->queryDispatch(rURL, ::rtl::OUString(), 0));
- return xDispatch;
+ Reference<frame::XDispatchProvider> xProvider (rxFrame, UNO_QUERY_THROW);
+ Reference<frame::XDispatch> xDispatch (xProvider->queryDispatch(rURL, ::rtl::OUString(), 0));
+ return xDispatch;
}
-
-
-
::rtl::OUString Tools::GetModuleName (
- const cssu::Reference<css::frame::XFrame>& rxFrame)
+ const cssu::Reference<css::frame::XFrame>& rxFrame)
{
- if ( ! rxFrame.is() || ! rxFrame->getController().is())
- return ::rtl::OUString();
+ if ( ! rxFrame.is() || ! rxFrame->getController().is())
+ return ::rtl::OUString();
- try
- {
- const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
- const Reference<frame::XModuleManager> xModuleManager (
- aContext.createComponent("com.sun.star.frame.ModuleManager"),
- UNO_QUERY_THROW);
- return xModuleManager->identify(rxFrame);
- }
- catch (const Exception&)
- {
- // Ignored.
- }
- return ::rtl::OUString();
+ try
+ {
+ const ::comphelper::ComponentContext aContext (::comphelper::getProcessServiceFactory());
+ const Reference<frame::XModuleManager> xModuleManager (
+ aContext.createComponent("com.sun.star.frame.ModuleManager"),
+ UNO_QUERY_THROW);
+ return xModuleManager->identify(rxFrame);
+ }
+ catch (const Exception&)
+ {
+ // Ignored.
+ }
+ return ::rtl::OUString();
}
-
} } // end of namespace sfx2::sidebar
+
+/* vim: set noet sw=4 ts=4: */