[Libreoffice-commits] core.git: forms/source include/svx svx/inc svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 22 20:16:50 UTC 2020
forms/source/solar/control/navtoolbar.cxx | 42 ++++++++-----------------
svx/inc/pch/precompiled_svx.hxx | 2 -
svx/source/dialog/srchdlg.cxx | 2 -
svx/source/form/labelitemwindow.cxx | 4 +-
svx/source/form/tbxform.cxx | 2 -
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 2 -
6 files changed, 22 insertions(+), 32 deletions(-)
New commits:
commit a9d797ed771632afafb702697a6f31e0c25e80cf
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jul 22 15:16:19 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jul 22 22:16:10 2020 +0200
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 at redhat.com>
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() )
diff --git a/svx/inc/labelitemwindow.hxx b/include/svx/labelitemwindow.hxx
similarity index 100%
rename from svx/inc/labelitemwindow.hxx
rename to include/svx/labelitemwindow.hxx
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index b2ce7362b84e..0c96cace089e 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -376,7 +376,6 @@
#include <fmprop.hxx>
#include <fmservs.hxx>
#include <helpids.h>
-#include <labelitemwindow.hxx>
#include <svx/AccessibleControlShape.hxx>
#include <svx/AccessibleShape.hxx>
#include <svx/AccessibleShapeInfo.hxx>
@@ -401,6 +400,7 @@
#include <svx/galmisc.hxx>
#include <svx/itemwin.hxx>
#include <svx/itextprovider.hxx>
+#include <svx/labelitemwindow.hxx>
#include <svx/numvset.hxx>
#include <svx/obj3d.hxx>
#include <svx/pageitem.hxx>
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 50615a73ff54..b47067a19e42 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -73,7 +73,7 @@
#include <findtextfield.hxx>
-#include <labelitemwindow.hxx>
+#include <svx/labelitemwindow.hxx>
#include <svx/xdef.hxx>
#include <officecfg/Office/Common.hxx>
diff --git a/svx/source/form/labelitemwindow.cxx b/svx/source/form/labelitemwindow.cxx
index fb6f6220d646..77965cbd4a4e 100644
--- a/svx/source/form/labelitemwindow.cxx
+++ b/svx/source/form/labelitemwindow.cxx
@@ -7,12 +7,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <labelitemwindow.hxx>
+#include <svx/labelitemwindow.hxx>
LabelItemWindow::LabelItemWindow(vcl::Window* pParent, const OUString& rLabel)
: InterimItemWindow(pParent, "svx/ui/labelbox.ui", "LabelBox")
, m_xLabel(m_xBuilder->weld_label("label"))
{
+ InitControlBase(m_xLabel.get());
+
m_xLabel->set_label(rLabel);
SetOptimalSize();
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 1a070374f3a9..dadbb362076f 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -25,7 +25,7 @@
#include <vcl/settings.hxx>
#include <svx/dialmgr.hxx>
-#include <labelitemwindow.hxx>
+#include <svx/labelitemwindow.hxx>
#include <svx/svxids.hrc>
#include <svx/strings.hrc>
#include <tbxform.hxx>
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index e8b19f006aa9..040aaa34aa16 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -56,7 +56,7 @@
#include <vcl/toolbox.hxx>
#include <vcl/svapp.hxx>
#include <rtl/instance.hxx>
-#include <labelitemwindow.hxx>
+#include <svx/labelitemwindow.hxx>
#include <svx/srchdlg.hxx>
#include <vcl/event.hxx>
More information about the Libreoffice-commits
mailing list