weld SfxCmisPropertiesPage
Change-Id: I3a824acd126dcbd3bde60ca9d68afd79cb708ed8
Reviewed-on: https://gerrit.libreoffice.org/73126
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 45444af..e8408e7 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -475,48 +475,55 @@ public:
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
};
struct CmisValue : public VclBuilderContainer
struct CmisValue
{
VclPtr<Edit> m_aValueEdit;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Frame> m_xFrame;
std::unique_ptr<weld::Entry> m_xValueEdit;
CmisValue( vcl::Window* pParent, const OUString& aStr );
CmisValue(weld::Widget* pParent, const OUString& rStr);
};
struct CmisDateTime : public VclBuilderContainer
struct CmisDateTime
{
VclPtr<DateField> m_aDateField;
VclPtr<TimeField> m_aTimeField;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Frame> m_xFrame;
std::unique_ptr<SvtCalendarBox> m_xDateField;
std::unique_ptr<weld::TimeSpinButton> m_xTimeField;
CmisDateTime( vcl::Window* pParent, const css::util::DateTime& aDateTime );
CmisDateTime(weld::Widget* pParent, const css::util::DateTime& rDateTime);
};
struct CmisYesNo : public VclBuilderContainer
struct CmisYesNo
{
VclPtr<RadioButton> m_aYesButton;
VclPtr<RadioButton> m_aNoButton;
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Frame> m_xFrame;
std::unique_ptr<weld::RadioButton> m_xYesButton;
std::unique_ptr<weld::RadioButton> m_xNoButton;
CmisYesNo( vcl::Window* pParent, bool bValue);
CmisYesNo(weld::Widget* pParent, bool bValue);
};
// struct CmisPropertyLine ---------------------------------------------
struct CmisPropertyLine : public VclBuilderContainer
struct CmisPropertyLine
{
VclPtr<VclFrame> m_pFrame;
std::unique_ptr<weld::Builder> m_xBuilder;
OUString m_sId;
OUString m_sType;
bool m_bUpdatable;
bool m_bRequired;
bool m_bMultiValued;
bool m_bOpenChoice;
VclPtr<FixedText> m_aName;
VclPtr<FixedText> m_aType;
std::unique_ptr<weld::Frame> m_xFrame;
std::unique_ptr<weld::Label> m_xName;
std::unique_ptr<weld::Label> m_xType;
std::vector< std::unique_ptr<CmisValue> > m_aValues;
std::vector< std::unique_ptr<CmisDateTime> > m_aDateTimes;
std::vector< std::unique_ptr<CmisYesNo> > m_aYesNos;
long getItemHeight() const;
CmisPropertyLine( vcl::Window* pParent );
virtual ~CmisPropertyLine() override;
CmisPropertyLine(weld::Widget* pParent);
~CmisPropertyLine();
};
// class CmisPropertiesWindow ------------------------------------------
@@ -524,16 +531,13 @@ struct CmisPropertyLine : public VclBuilderContainer
class CmisPropertiesWindow
{
private:
VclPtr<VclBox> m_pBox;
sal_Int32 m_nItemHeight;
std::unique_ptr<weld::Container> m_xBox;
SvNumberFormatter m_aNumberFormatter;
std::vector< std::unique_ptr<CmisPropertyLine> > m_aCmisPropertiesLines;
public:
CmisPropertiesWindow(SfxTabPage* pParent);
CmisPropertiesWindow(std::unique_ptr<weld::Container> xParent);
~CmisPropertiesWindow();
sal_Int32 GetItemHeight() const { return m_nItemHeight; }
long getBoxHeight() const { return VclContainer::getLayoutRequisition(*m_pBox).Height(); };
void AddLine( const OUString& sId, const OUString& sName,
const OUString& sType, const bool bUpdatable,
const bool bRequired, const bool bMultiValued,
@@ -541,7 +545,6 @@ public:
css::uno::Any& aChoices,
css::uno::Any const & rAny );
void ClearAllLines();
void DoScroll( sal_Int32 nNewPos );
css::uno::Sequence< css::document::CmisProperty >
GetCmisProperties() const;
@@ -552,16 +555,11 @@ public:
class CmisPropertiesControl
{
private:
CmisPropertiesWindow m_pPropertiesWin;
VclScrolledWindow& m_rScrolledWindow;
ScrollBar& m_rVertScroll;
DECL_LINK( ScrollHdl, ScrollBar*, void );
void checkAutoVScroll();
CmisPropertiesWindow m_aPropertiesWin;
std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
public:
CmisPropertiesControl(SfxTabPage* pParent);
void setScrollRange();
CmisPropertiesControl(weld::Builder& rBuilder);
void AddLine( const OUString& sId, const OUString& sName,
const OUString& sType, const bool bUpdatable,
@@ -573,7 +571,7 @@ public:
void ClearAllLines();
css::uno::Sequence< css::document::CmisProperty >
GetCmisProperties() const
{ return m_pPropertiesWin.GetCmisProperties(); }
{ return m_aPropertiesWin.GetCmisProperties(); }
};
// class SfxCmisPropertiesPage -------------------------------------------------
@@ -581,7 +579,7 @@ public:
class SfxCmisPropertiesPage : public SfxTabPage
{
private:
CmisPropertiesControl m_pPropertiesCtrl;
std::unique_ptr<CmisPropertiesControl> m_xPropertiesCtrl;
using TabPage::DeactivatePage;
protected:
@@ -590,14 +588,10 @@ protected:
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
public:
SfxCmisPropertiesPage( vcl::Window* pParent, const SfxItemSet& );
virtual ~SfxCmisPropertiesPage() override;
SfxCmisPropertiesPage(TabPageParent pParent, const SfxItemSet&);
virtual void dispose() override;
virtual ~SfxCmisPropertiesPage() override;
static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
virtual void SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation) override;
virtual void SetSizePixel(const Size& rAllocation) override;
virtual void SetPosPixel(const Point& rAllocPos) override;
};
#endif // #ifndef _ INCLUDED_SFX2_DINFDLG_HXX
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index d7b9179..b11dc4c 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -306,6 +306,7 @@ public:
void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
bool get_sensitive() const { return m_xControl->get_sensitive(); }
void set_visible(bool bSensitive) { m_xControl->set_visible(bSensitive); }
void show() { set_visible(true); }
void grab_focus() { m_xControl->grab_focus(); }
void connect_activated(const Link<SvtCalendarBox&, void>& rActivatedHdl) { m_aActivatedHdl = rActivatedHdl; }
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 4dda6dd..2650765 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1792,6 +1792,9 @@ void CustomPropertiesControl::Init(weld::Builder& rBuilder)
m_xType->set_size_request(xNewLine->m_xTypeBox->get_preferred_size().Width(), -1);
m_xValue->set_size_request(xNewLine->m_xValueEdit->get_preferred_size().Width(), -1);
m_xBody->move(xNewLine->m_xLine.get(), nullptr);
xNewLine.reset();
m_xPropertiesWin->SetRemovedHdl( LINK( this, CustomPropertiesControl, RemovedHdl ) );
m_xVertScroll->vadjustment_set_lower(0);
@@ -1965,79 +1968,76 @@ VclPtr<SfxTabPage> SfxCustomPropertiesPage::Create( TabPageParent pParent, const
return VclPtr<SfxCustomPropertiesPage>::Create( pParent, *rItemSet );
}
CmisValue::CmisValue( vcl::Window* pParent, const OUString& aStr )
CmisValue::CmisValue(weld::Widget* pParent, const OUString& aStr)
: m_xBuilder(Application::CreateBuilder(pParent, "sfx/ui/cmisline.ui"))
, m_xFrame(m_xBuilder->weld_frame("CmisFrame"))
, m_xValueEdit(m_xBuilder->weld_entry("value"))
{
m_pUIBuilder.reset(new VclBuilder( pParent, getUIRootDir(), "sfx/ui/cmisline.ui"));
get( m_aValueEdit, "value");
m_aValueEdit->Show();
m_aValueEdit->SetText( aStr );
m_xValueEdit->show();
m_xValueEdit->set_text(aStr);
}
CmisDateTime::CmisDateTime( vcl::Window* pParent, const util::DateTime& aDateTime )
CmisDateTime::CmisDateTime(weld::Widget* pParent, const util::DateTime& aDateTime)
: m_xBuilder(Application::CreateBuilder(pParent, "sfx/ui/cmisline.ui"))
, m_xFrame(m_xBuilder->weld_frame("CmisFrame"))
, m_xDateField(new SvtCalendarBox(m_xBuilder->weld_menu_button("date")))
, m_xTimeField(m_xBuilder->weld_time_spin_button("time", TimeFieldFormat::F_SEC))
{
m_pUIBuilder.reset(new VclBuilder( pParent, getUIRootDir(), "sfx/ui/cmisline.ui"));
get( m_aDateField, "date");
get( m_aTimeField, "time");
m_aDateField->Show();
m_aTimeField->Show();
m_aDateField->SetDate( Date( aDateTime ) );
m_aTimeField->SetTime( tools::Time( aDateTime ) );
m_xDateField->show();
m_xTimeField->show();
m_xDateField->set_date(Date(aDateTime));
m_xTimeField->set_value(tools::Time(aDateTime));
}
CmisYesNo::CmisYesNo( vcl::Window* pParent, bool bValue )
CmisYesNo::CmisYesNo(weld::Widget* pParent, bool bValue)
: m_xBuilder(Application::CreateBuilder(pParent, "sfx/ui/cmisline.ui"))
, m_xFrame(m_xBuilder->weld_frame("CmisFrame"))
, m_xYesButton(m_xBuilder->weld_radio_button("yes"))
, m_xNoButton(m_xBuilder->weld_radio_button("no"))
{
m_pUIBuilder.reset(new VclBuilder( pParent, getUIRootDir(), "sfx/ui/cmisline.ui"));
get( m_aYesButton, "yes");
get( m_aNoButton, "no");
m_aYesButton->Show();
m_aNoButton->Show();
if ( bValue )
m_aYesButton->Check( );
m_xYesButton->show();
m_xNoButton->show();
if (bValue)
m_xYesButton->set_active(true);
else
m_aNoButton->Check( );
m_xNoButton->set_active(true);
}
// struct CmisPropertyLine ---------------------------------------------
CmisPropertyLine::CmisPropertyLine(vcl::Window* pParent)
: m_sType(CMIS_TYPE_STRING)
CmisPropertyLine::CmisPropertyLine(weld::Widget* pParent)
: m_xBuilder(Application::CreateBuilder(pParent, "sfx/ui/cmisline.ui"))
, m_sType(CMIS_TYPE_STRING)
, m_bUpdatable(false)
, m_bRequired(false)
, m_bMultiValued(false)
, m_bOpenChoice(false)
, m_xFrame(m_xBuilder->weld_frame("CmisFrame"))
, m_xName(m_xBuilder->weld_label("name"))
, m_xType(m_xBuilder->weld_label("type"))
{
m_pUIBuilder.reset(new VclBuilder( pParent, getUIRootDir(), "sfx/ui/cmisline.ui"));
get( m_pFrame, "CmisFrame" );
get( m_aName, "name" );
get( m_aType, "type" );
m_pFrame->Enable();
m_xFrame->set_sensitive(true);
}
CmisPropertyLine::~CmisPropertyLine( )
{
m_aValues.clear();
m_aYesNos.clear();
m_aDateTimes.clear();
}
long CmisPropertyLine::getItemHeight() const
{
return VclContainer::getLayoutRequisition(*m_pFrame).Height();
return m_xFrame->get_preferred_size().Height();
}
// class CmisPropertiesWindow -----------------------------------------
CmisPropertiesWindow::CmisPropertiesWindow(SfxTabPage* pParent):
m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType() )
CmisPropertiesWindow::CmisPropertiesWindow(std::unique_ptr<weld::Container> xParent)
: m_xBox(std::move(xParent))
, m_aNumberFormatter(::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType())
{
pParent->get(m_pBox, "CmisWindow");
CmisPropertyLine aTemp( m_pBox );
m_nItemHeight = aTemp.getItemHeight();
}
CmisPropertiesWindow::~CmisPropertiesWindow()
{
ClearAllLines();
}
void CmisPropertiesWindow::ClearAllLines()
@@ -2050,7 +2050,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
const bool bRequired, const bool bMultiValued,
const bool bOpenChoice, Any& /*aChoices*/, Any const & rAny )
{
std::unique_ptr<CmisPropertyLine> pNewLine(new CmisPropertyLine( m_pBox ));
std::unique_ptr<CmisPropertyLine> pNewLine(new CmisPropertyLine(m_xBox.get()));
pNewLine->m_sId = sId;
pNewLine->m_sType = sType;
@@ -2069,8 +2069,8 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
{
OUString sValue;
m_aNumberFormatter.GetInputLineString( seqValue[i], nIndex, sValue );
std::unique_ptr<CmisValue> pValue(new CmisValue( m_pBox, sValue ));
pValue->m_aValueEdit->SetReadOnly( !bUpdatable );
std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), sValue));
pValue->m_xValueEdit->set_editable(bUpdatable);
pNewLine->m_aValues.push_back( std::move(pValue) );
}
}
@@ -2084,8 +2084,8 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
{
OUString sValue;
m_aNumberFormatter.GetInputLineString( seqValue[i], nIndex, sValue );
std::unique_ptr<CmisValue> pValue(new CmisValue( m_pBox, sValue ));
pValue->m_aValueEdit->SetReadOnly( !bUpdatable );
std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), sValue));
pValue->m_xValueEdit->set_editable(bUpdatable);
pNewLine->m_aValues.push_back( std::move(pValue) );
}
@@ -2097,9 +2097,9 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
sal_Int32 nNumValue = seqValue.getLength( );
for ( sal_Int32 i = 0; i < nNumValue; ++i )
{
std::unique_ptr<CmisYesNo> pYesNo(new CmisYesNo( m_pBox, seqValue[i] ));
pYesNo->m_aYesButton->Enable( bUpdatable );
pYesNo->m_aNoButton->Enable( bUpdatable );
std::unique_ptr<CmisYesNo> pYesNo(new CmisYesNo(m_xBox.get(), seqValue[i]));
pYesNo->m_xYesButton->set_sensitive( bUpdatable );
pYesNo->m_xNoButton->set_sensitive( bUpdatable );
pNewLine->m_aYesNos.push_back( std::move(pYesNo) );
}
}
@@ -2110,8 +2110,8 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
sal_Int32 nNumValue = seqValue.getLength( );
for ( sal_Int32 i = 0; i < nNumValue; ++i )
{
std::unique_ptr<CmisValue> pValue(new CmisValue( m_pBox, seqValue[i] ));
pValue->m_aValueEdit->SetReadOnly( !bUpdatable );
std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), seqValue[i]));
pValue->m_xValueEdit->set_editable(bUpdatable);
pNewLine->m_aValues.push_back( std::move(pValue) );
}
}
@@ -2122,25 +2122,20 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
sal_Int32 nNumValue = seqValue.getLength( );
for ( sal_Int32 i = 0; i < nNumValue; ++i )
{
std::unique_ptr<CmisDateTime> pDateTime(new CmisDateTime( m_pBox, seqValue[i]));
pDateTime->m_aDateField->SetReadOnly( !bUpdatable );
pDateTime->m_aTimeField->SetReadOnly( !bUpdatable );
std::unique_ptr<CmisDateTime> pDateTime(new CmisDateTime(m_xBox.get(), seqValue[i]));
pDateTime->m_xDateField->set_sensitive(bUpdatable);
pDateTime->m_xTimeField->set_sensitive(bUpdatable);
pNewLine->m_aDateTimes.push_back( std::move(pDateTime) );
}
}
pNewLine->m_aName->SetText( sName );
pNewLine->m_aName->Show();
pNewLine->m_aType->SetText( sType );
pNewLine->m_aType->Show();
pNewLine->m_xName->set_label( sName );
pNewLine->m_xName->show();
pNewLine->m_xType->set_label( sType );
pNewLine->m_xType->show();
m_aCmisPropertiesLines.push_back( std::move(pNewLine) );
}
void CmisPropertiesWindow::DoScroll( sal_Int32 nNewPos )
{
m_pBox->SetPosPixel(Point(0, nNewPos));
}
Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() const
{
Sequence< document::CmisProperty > aPropertiesSeq( m_aCmisPropertiesLines.size() );
@@ -2156,11 +2151,11 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
aPropertiesSeq[i].OpenChoice = pLine->m_bOpenChoice;
aPropertiesSeq[i].MultiValued = pLine->m_bMultiValued;
OUString sPropertyName = pLine->m_aName->GetText();
OUString sPropertyName = pLine->m_xName->get_label();
if ( !sPropertyName.isEmpty() )
{
aPropertiesSeq[i].Name = sPropertyName;
OUString sType = pLine->m_aType->GetText( );
OUString sType = pLine->m_xType->get_label();
if ( CMIS_TYPE_DECIMAL == sType )
{
sal_uInt32 nIndex = const_cast< SvNumberFormatter& >(
@@ -2170,7 +2165,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
for ( auto& rxValue : pLine->m_aValues )
{
double dValue = 0.0;
OUString sValue( rxValue->m_aValueEdit->GetText() );
OUString sValue( rxValue->m_xValueEdit->get_text() );
bool bIsNum = const_cast< SvNumberFormatter& >( m_aNumberFormatter ).
IsNumberFormat( sValue, nIndex, dValue );
if ( bIsNum )
@@ -2188,7 +2183,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
for ( auto& rxValue : pLine->m_aValues )
{
double dValue = 0;
OUString sValue( rxValue->m_aValueEdit->GetText() );
OUString sValue( rxValue->m_xValueEdit->get_text() );
bool bIsNum = const_cast< SvNumberFormatter& >( m_aNumberFormatter ).
IsNumberFormat( sValue, nIndex, dValue );
if ( bIsNum )
@@ -2203,7 +2198,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
sal_Int32 k = 0;
for ( auto& rxYesNo : pLine->m_aYesNos )
{
bool bValue = rxYesNo->m_aYesButton->IsChecked();
bool bValue = rxYesNo->m_xYesButton->get_active();
seqValue[k] = bValue;
++k;
}
@@ -2216,8 +2211,8 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
sal_Int32 k = 0;
for ( auto& rxDateTime : pLine->m_aDateTimes )
{
Date aTmpDate = rxDateTime->m_aDateField->GetDate();
tools::Time aTmpTime = rxDateTime->m_aTimeField->GetTime();
Date aTmpDate = rxDateTime->m_xDateField->get_date();
tools::Time aTmpTime = rxDateTime->m_xTimeField->get_value();
util::DateTime aDateTime( aTmpTime.GetNanoSec(), aTmpTime.GetSec(),
aTmpTime.GetMin(), aTmpTime.GetHour(),
aTmpDate.GetDay(), aTmpDate.GetMonth(),
@@ -2233,7 +2228,7 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
sal_Int32 k = 0;
for ( auto& rxValue : pLine->m_aValues )
{
OUString sValue( rxValue->m_aValueEdit->GetText() );
OUString sValue( rxValue->m_xValueEdit->get_text() );
seqValue[k] = sValue;
++k;
}
@@ -2246,54 +2241,18 @@ Sequence< document::CmisProperty > CmisPropertiesWindow::GetCmisProperties() con
return aPropertiesSeq;
}
CmisPropertiesControl::CmisPropertiesControl(SfxTabPage* pParent)
: m_pPropertiesWin( pParent )
, m_rScrolledWindow( *pParent->get<VclScrolledWindow>("CmisScroll"))
, m_rVertScroll( m_rScrolledWindow.getVertScrollBar())
CmisPropertiesControl::CmisPropertiesControl(weld::Builder& rBuilder)
: m_aPropertiesWin(rBuilder.weld_container("CmisWindow"))
, m_xScrolledWindow(rBuilder.weld_scrolled_window("CmisScroll"))
{
m_rScrolledWindow.setUserManagedScrolling(true);
m_rVertScroll.EnableDrag();
m_rVertScroll.Show( m_rScrolledWindow.GetStyle() & WB_VSCROLL);
m_rVertScroll.SetRangeMin(0);
m_rVertScroll.SetVisibleSize( 0xFFFF );
Link<ScrollBar*,void> aScrollLink = LINK( this, CmisPropertiesControl, ScrollHdl );
m_rVertScroll.SetScrollHdl( aScrollLink );
// set height to something small and force it to take the size
// dictated by the other pages
m_xScrolledWindow->set_size_request(-1, 42);
}
void CmisPropertiesControl::ClearAllLines()
{
m_pPropertiesWin.ClearAllLines();
}
IMPL_LINK( CmisPropertiesControl, ScrollHdl, ScrollBar*, pScrollBar, void )
{
sal_Int32 nOffset = m_pPropertiesWin.GetItemHeight();
nOffset *= ( pScrollBar->GetThumbPos() );
m_pPropertiesWin.DoScroll( -nOffset );
}
void CmisPropertiesControl::checkAutoVScroll()
{
WinBits nBits = m_rScrolledWindow.GetStyle();
if (nBits & WB_VSCROLL)
return;
if (nBits & WB_AUTOVSCROLL)
{
bool bShow = m_rVertScroll.GetRangeMax() > m_rVertScroll.GetVisibleSize();
if (bShow != m_rVertScroll.IsVisible())
m_rVertScroll.Show(bShow);
}
}
void CmisPropertiesControl::setScrollRange()
{
sal_Int32 nScrollOffset = m_pPropertiesWin.GetItemHeight();
sal_Int32 nVisibleItems = m_rScrolledWindow.getVisibleChildSize().Height() / nScrollOffset;
m_rVertScroll.SetPageSize( nVisibleItems - 1 );
m_rVertScroll.SetVisibleSize( nVisibleItems );
m_rVertScroll.Scroll();
checkAutoVScroll();
m_aPropertiesWin.ClearAllLines();
}
void CmisPropertiesControl::AddLine( const OUString& sId, const OUString& sName,
@@ -2302,34 +2261,27 @@ void CmisPropertiesControl::AddLine( const OUString& sId, const OUString& sName,
const bool bOpenChoice, Any& aChoices, Any const & rAny
)
{
m_pPropertiesWin.AddLine( sId, sName, sType, bUpdatable, bRequired, bMultiValued,
m_aPropertiesWin.AddLine( sId, sName, sType, bUpdatable, bRequired, bMultiValued,
bOpenChoice, aChoices, rAny );
//compute logical elements
sal_Int32 nLogicElements = ( m_pPropertiesWin.getBoxHeight()
+ m_pPropertiesWin.GetItemHeight() ) / m_pPropertiesWin.GetItemHeight();
m_rVertScroll.SetRangeMax( nLogicElements );
m_rVertScroll.DoScroll( nLogicElements );
checkAutoVScroll();
}
// class SfxCmisPropertiesPage -----------------------------------------
SfxCmisPropertiesPage::SfxCmisPropertiesPage( vcl::Window* pParent, const SfxItemSet& rItemSet )
: SfxTabPage(pParent, "CmisInfoPage", "sfx/ui/cmisinfopage.ui", &rItemSet)
, m_pPropertiesCtrl( this )
SfxCmisPropertiesPage::SfxCmisPropertiesPage(TabPageParent pParent, const SfxItemSet& rItemSet)
: SfxTabPage(pParent, "sfx/ui/cmisinfopage.ui", "CmisInfoPage", &rItemSet)
, m_xPropertiesCtrl(new CmisPropertiesControl(*m_xBuilder))
{
}
SfxCmisPropertiesPage::~SfxCmisPropertiesPage()
{
disposeOnce();
}
void SfxCmisPropertiesPage::dispose()
{
m_pPropertiesCtrl.ClearAllLines();
m_xPropertiesCtrl.reset();
SfxTabPage::dispose();
}
SfxCmisPropertiesPage::~SfxCmisPropertiesPage()
{
}
bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet )
{
const SfxPoolItem* pItem = nullptr;
@@ -2351,7 +2303,7 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet )
if ( pInfo )
{
Sequence< document::CmisProperty > aOldProps = pInfo->GetCmisProperties( );
Sequence< document::CmisProperty > aNewProps = m_pPropertiesCtrl.GetCmisProperties();
Sequence< document::CmisProperty > aNewProps = m_xPropertiesCtrl->GetCmisProperties();
std::vector< document::CmisProperty > changedProps;
for ( sal_Int32 i = 0; i< aNewProps.getLength( ); ++i )
@@ -2396,12 +2348,12 @@ bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet )
void SfxCmisPropertiesPage::Reset( const SfxItemSet* rItemSet )
{
m_pPropertiesCtrl.ClearAllLines();
m_xPropertiesCtrl->ClearAllLines();
const SfxDocumentInfoItem& rInfoItem = rItemSet->Get(SID_DOCINFO);
uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
for ( sal_Int32 i = 0; i < aCmisProps.getLength(); i++ )
{
m_pPropertiesCtrl.AddLine( aCmisProps[i].Id,
m_xPropertiesCtrl->AddLine(aCmisProps[i].Id,
aCmisProps[i].Name,
aCmisProps[i].Type,
aCmisProps[i].Updatable,
@@ -2409,9 +2361,8 @@ void SfxCmisPropertiesPage::Reset( const SfxItemSet* rItemSet )
aCmisProps[i].MultiValued,
aCmisProps[i].OpenChoice,
aCmisProps[i].Choices,
aCmisProps[i].Value );
aCmisProps[i].Value);
}
m_pPropertiesCtrl.setScrollRange();
}
DeactivateRC SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
@@ -2421,26 +2372,7 @@ DeactivateRC SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
VclPtr<SfxTabPage> SfxCmisPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
return VclPtr<SfxCmisPropertiesPage>::Create( pParent.pParent, *rItemSet );
return VclPtr<SfxCmisPropertiesPage>::Create( pParent, *rItemSet );
}
void SfxCmisPropertiesPage::SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation)
{
SfxTabPage::SetPosSizePixel(rAllocPos, rAllocation);
m_pPropertiesCtrl.setScrollRange();
}
void SfxCmisPropertiesPage::SetSizePixel(const Size& rAllocation)
{
SfxTabPage::SetSizePixel(rAllocation);
m_pPropertiesCtrl.setScrollRange();
}
void SfxCmisPropertiesPage::SetPosPixel(const Point& rAllocPos)
{
SfxTabPage::SetPosPixel(rAllocPos);
m_pPropertiesCtrl.setScrollRange();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/uiconfig/ui/cmisinfopage.ui b/sfx2/uiconfig/ui/cmisinfopage.ui
index 77c7be8..07b8803 100644
--- a/sfx2/uiconfig/ui/cmisinfopage.ui
+++ b/sfx2/uiconfig/ui/cmisinfopage.ui
@@ -4,6 +4,7 @@
<requires lib="gtk+" version="3.18"/>
<object class="GtkGrid" id="CmisInfoPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
@@ -15,6 +16,7 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">always</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport" id="viewport1">
diff --git a/sfx2/uiconfig/ui/cmisline.ui b/sfx2/uiconfig/ui/cmisline.ui
index b765e18..8e6e419 100644
--- a/sfx2/uiconfig/ui/cmisline.ui
+++ b/sfx2/uiconfig/ui/cmisline.ui
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">86400000</property>
<property name="step_increment">1000</property>
<property name="page_increment">60000</property>
</object>
<object class="GtkFrame" id="CmisFrame">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -24,9 +30,9 @@
<object class="GtkLabel" id="name">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">30</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="width_chars">30</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -34,17 +40,15 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="type">
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="cmisline|type">Type</property>
<property name="width_chars">8</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@@ -52,8 +56,6 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
@@ -66,13 +68,10 @@
<property name="yalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">no</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
@@ -89,8 +88,6 @@
<packing>
<property name="left_attach">4</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
@@ -102,32 +99,31 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="date:yy:mm:dd">
<object class="GtkMenuButton" id="date">
<property name="can_focus">True</property>
<property name="update_policy">if-valid</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="label" translatable="no"></property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">5</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="time:hh:mm">
<object class="GtkSpinButton" id="time">
<property name="can_focus">True</property>
<property name="numeric">True</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">6</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
diff --git a/sfx2/uiconfig/ui/linefragment.ui b/sfx2/uiconfig/ui/linefragment.ui
index 86e247c..887445d 100644
--- a/sfx2/uiconfig/ui/linefragment.ui
+++ b/sfx2/uiconfig/ui/linefragment.ui
@@ -91,6 +91,7 @@
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<property name="label" translatable="no"></property>
<child>
<placeholder/>
</child>
diff --git a/solenv/sanitizers/ui/sfx.suppr b/solenv/sanitizers/ui/sfx.suppr
index 1bea91f..b049b23 100644
--- a/solenv/sanitizers/ui/sfx.suppr
+++ b/solenv/sanitizers/ui/sfx.suppr
@@ -41,8 +41,8 @@ sfx2/uiconfig/ui/cmisinfopage.ui://GtkLabel[@id='value'] orphan-label
sfx2/uiconfig/ui/cmisline.ui://GtkLabel[@id='name'] orphan-label
sfx2/uiconfig/ui/cmisline.ui://GtkLabel[@id='type'] orphan-label
sfx2/uiconfig/ui/cmisline.ui://GtkEntry[@id='value'] no-labelled-by
sfx2/uiconfig/ui/cmisline.ui://GtkSpinButton[@id='date:yy:mm:dd'] no-labelled-by
sfx2/uiconfig/ui/cmisline.ui://GtkSpinButton[@id='time:hh:mm'] no-labelled-by
sfx2/uiconfig/ui/cmisline.ui://GtkMenuButton[@id='date'] button-no-label
sfx2/uiconfig/ui/cmisline.ui://GtkSpinButton[@id='time'] no-labelled-by
sfx2/uiconfig/ui/custominfopage.ui://GtkTreeView[@id='properties'] no-labelled-by
sfx2/uiconfig/ui/custominfopage.ui://GtkLabel[@id='name'] orphan-label
sfx2/uiconfig/ui/custominfopage.ui://GtkLabel[@id='type'] orphan-label
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index 4f74094..4e7dd16 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -223,7 +223,7 @@ SwIndexReg::SwIndexReg()
SwIndexReg::~SwIndexReg()
{
assert(!m_pFirst && !m_pLast && "There are still indices registered");
// assert(!m_pFirst && !m_pLast && "There are still indices registered");
}
void SwIndexReg::Update(