summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-22 15:16:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-22 22:16:10 +0200
commita9d797ed771632afafb702697a6f31e0c25e80cf (patch)
treede806678bc02b1ee20e2593009fd5138abed1e3b /forms
parent19f44fe53863ef8c9087aa965b786544f71ffdc8 (diff)
weld form navigator label item windows
Change-Id: I2e49ffda6dc29746819a61db2848b6bcfe5f4a23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94650 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/solar/control/navtoolbar.cxx42
1 files changed, 15 insertions, 27 deletions
diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx
index d361aa0a94c5..687f4dffd1b7 100644
--- a/forms/source/solar/control/navtoolbar.cxx
+++ b/forms/source/solar/control/navtoolbar.cxx
@@ -27,6 +27,8 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/form/runtime/FormFeature.hpp>
+#include <svx/labelitemwindow.hxx>
+
#include <vcl/event.hxx>
#include <vcl/fixed.hxx>
#include <vcl/commandinfoprovider.hxx>
@@ -224,7 +226,12 @@ namespace frm
vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( static_cast<sal_uInt16>(_nFeatureId) );
if ( pItemWindow )
- pItemWindow->SetText( _rText );
+ {
+ if (_nFeatureId == FormFeature::TotalRecords)
+ static_cast<LabelItemWindow*>(pItemWindow)->set_label(_rText);
+ else
+ pItemWindow->SetText( _rText );
+ }
else
m_pToolbar->SetItemText( static_cast<sal_uInt16>(_nFeatureId), _rText );
}
@@ -300,30 +307,14 @@ namespace frm
pItemWindow = VclPtr<RecordPositionInput>::Create( m_pToolbar );
static_cast< RecordPositionInput* >( pItemWindow )->setDispatcher( m_pDispatcher );
}
- else if ( LID_RECORD_FILLER == pSupportedFeatures->nId )
- {
- pItemWindow = VclPtr<FixedText>::Create( m_pToolbar, WB_CENTER | WB_VCENTER );
- pItemWindow->SetBackground(Wallpaper(COL_TRANSPARENT));
- }
- else
- {
- pItemWindow = VclPtr<FixedText>::Create( m_pToolbar, WB_VCENTER );
- pItemWindow->SetBackground();
- pItemWindow->SetPaintTransparent(true);
- }
- m_aChildWins.emplace_back(pItemWindow );
-
- switch ( pSupportedFeatures->nId )
- {
- case LID_RECORD_LABEL:
- pItemWindow->SetText( getLabelString( RID_STR_LABEL_RECORD ) );
- break;
-
- case LID_RECORD_FILLER:
- pItemWindow->SetText( getLabelString( RID_STR_LABEL_OF ) );
- break;
- }
+ else if (pSupportedFeatures->nId == LID_RECORD_FILLER)
+ pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, getLabelString(RID_STR_LABEL_OF));
+ else if (pSupportedFeatures->nId == LID_RECORD_LABEL)
+ pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, getLabelString(RID_STR_LABEL_RECORD));
+ else if (pSupportedFeatures->nId == FormFeature::TotalRecords)
+ pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, "");
+ m_aChildWins.emplace_back(pItemWindow );
m_pToolbar->SetItemWindow( pSupportedFeatures->nId, pItemWindow );
}
}
@@ -642,7 +633,6 @@ namespace frm
m_pToolbar->SetItemWindow( _nItemId, _pItemWindow );
}
-
void NavigationToolBar::enableItemRTL( sal_uInt16 /*_nItemId*/, vcl::Window* _pItemWindow, const void* _pIsRTLEnabled )
{
_pItemWindow->EnableRTL( *static_cast< const sal_Bool* >( _pIsRTLEnabled ) );
@@ -660,13 +650,11 @@ namespace frm
SetBorderStyle( WindowBorderStyle::MONO );
}
-
void RecordPositionInput::setDispatcher( const IFeatureDispatcher* _pDispatcher )
{
m_pDispatcher = _pDispatcher;
}
-
void RecordPositionInput::FirePosition( bool _bForce )
{
if ( _bForce || IsValueChangedFromSaved() )