summaryrefslogtreecommitdiffstats
path: root/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/deployment/gui/dp_gui_updatedialog.cxx')
-rw-r--r--desktop/source/deployment/gui/dp_gui_updatedialog.cxx48
1 files changed, 20 insertions, 28 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 26820c5ea97f..85786e63535c 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -117,13 +117,13 @@ struct UpdateDialog::IgnoredUpdate {
OUString sExtensionID;
OUString sVersion;
- IgnoredUpdate( const OUString &rExtensionID, const OUString &rVersion );
+ IgnoredUpdate( OUString aExtensionID, OUString aVersion );
};
-UpdateDialog::IgnoredUpdate::IgnoredUpdate( const OUString &rExtensionID, const OUString &rVersion ):
- sExtensionID( rExtensionID ),
- sVersion( rVersion )
+UpdateDialog::IgnoredUpdate::IgnoredUpdate( OUString aExtensionID, OUString aVersion ):
+ sExtensionID(std::move( aExtensionID )),
+ sVersion(std::move( aVersion ))
{}
@@ -134,11 +134,11 @@ struct UpdateDialog::Index
sal_uInt16 m_nIndex;
OUString m_aName;
- Index( Kind theKind, sal_uInt16 nIndex, const OUString &rName ) :
+ Index( Kind theKind, sal_uInt16 nIndex, OUString aName ) :
m_eKind( theKind ),
m_bIgnored( false ),
m_nIndex( nIndex ),
- m_aName( rName ) {}
+ m_aName(std::move( aName )) {}
};
@@ -489,23 +489,23 @@ short UpdateDialog::run() {
IMPL_LINK(UpdateDialog, entryToggled, const weld::TreeView::iter_col&, rRowCol, void)
{
// error's can't be enabled
- const UpdateDialog::Index* p = reinterpret_cast<UpdateDialog::Index const *>(m_xUpdates->get_id(rRowCol.first).toInt64());
+ const UpdateDialog::Index* p = weld::fromId<UpdateDialog::Index const *>(m_xUpdates->get_id(rRowCol.first));
if (p->m_eKind == SPECIFIC_ERROR)
m_xUpdates->set_toggle(rRowCol.first, TRISTATE_FALSE);
enableOk();
}
-void UpdateDialog::insertItem(UpdateDialog::Index *pEntry, bool bEnabledCheckBox)
+void UpdateDialog::insertItem(const UpdateDialog::Index *pEntry, bool bEnabledCheckBox)
{
int nEntry = m_xUpdates->n_children();
m_xUpdates->append();
m_xUpdates->set_toggle(nEntry, bEnabledCheckBox ? TRISTATE_TRUE : TRISTATE_FALSE);
m_xUpdates->set_text(nEntry, pEntry->m_aName, 0);
- m_xUpdates->set_id(nEntry, OUString::number(reinterpret_cast<sal_Int64>(pEntry)));
+ m_xUpdates->set_id(nEntry, weld::toId(pEntry));
}
-void UpdateDialog::addAdditional(UpdateDialog::Index * index, bool bEnabledCheckBox)
+void UpdateDialog::addAdditional(const UpdateDialog::Index * index, bool bEnabledCheckBox)
{
m_xAll->set_sensitive(true);
if (m_xAll->get_active())
@@ -658,20 +658,19 @@ void UpdateDialog::notifyMenubar( bool bPrepareOnly, bool bRecheckOnly )
for (sal_uInt16 i = 0, nItemCount = m_xUpdates->n_children(); i < nItemCount; ++i)
{
- UpdateDialog::Index const * p = reinterpret_cast< UpdateDialog::Index const * >(m_xUpdates->get_id(i).toInt64());
+ UpdateDialog::Index const * p = weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(i));
if ( p->m_eKind == ENABLED_UPDATE )
{
dp_gui::UpdateData aUpdData = m_enabledUpdates[ p->m_nIndex ];
dp_misc::DescriptionInfoset aInfoset( m_context, aUpdData.aUpdateInfo );
- uno::Sequence< OUString > aItem
+ aItemList.realloc(nCount + 1);
+ aItemList.getArray()[nCount] =
{
dp_misc::getIdentifier( aUpdData.aInstalledPackage ),
aInfoset.getVersion()
};
- aItemList.realloc( nCount + 1 );
- aItemList.getArray()[ nCount ] = aItem;
nCount += 1;
}
else
@@ -829,7 +828,7 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, weld::TreeView&, void)
const UpdateDialog::Index* p = nullptr;
if (nSelectedPos != -1)
- p = reinterpret_cast<UpdateDialog::Index const *>(m_xUpdates->get_id(nSelectedPos).toInt64());
+ p = weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(nSelectedPos));
if (p != nullptr)
{
sal_uInt16 pos = p->m_nIndex;
@@ -881,31 +880,25 @@ IMPL_LINK_NOARG(UpdateDialog, selectionHandler, weld::TreeView&, void)
m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), utl::ConfigManager::getProductName() );
}
- b.append(m_noInstall);
- b.append(LF);
- b.append(m_noDependency);
+ b.append(m_noInstall + OUStringChar(LF) + m_noDependency);
for (sal_Int32 i = 0;
i < data.unsatisfiedDependencies.getLength(); ++i)
{
- b.append(LF);
- b.append(" ");
+ b.append(OUStringChar(LF) + " ");
// U+2003 EM SPACE would be better than two spaces,
// but some fonts do not contain it
b.append(
confineToParagraph(
data.unsatisfiedDependencies[i]));
}
- b.append(LF);
- b.append(" ");
- b.append(m_noDependencyCurVer);
+ b.append(OUStringChar(LF) + " " + m_noDependencyCurVer);
}
break;
}
case SPECIFIC_ERROR:
{
UpdateDialog::SpecificError & data = m_specificErrors[ pos ];
- b.append(m_failure);
- b.append(LF);
+ b.append(m_failure + OUStringChar(LF));
b.append( data.message.isEmpty() ? m_unknownError : data.message );
break;
}
@@ -941,7 +934,7 @@ IMPL_LINK_NOARG(UpdateDialog, allHandler, weld::Toggleable&, void)
for (sal_uInt16 i = m_xUpdates->n_children(); i != 0 ;)
{
i -= 1;
- UpdateDialog::Index const * p = reinterpret_cast< UpdateDialog::Index const * >( m_xUpdates->get_id(i).toInt64() );
+ UpdateDialog::Index const * p = weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(i));
if ( p->m_bIgnored || ( p->m_eKind != ENABLED_UPDATE ) )
{
m_xUpdates->remove(i);
@@ -976,8 +969,7 @@ IMPL_LINK_NOARG(UpdateDialog, okHandler, weld::Button&, void)
for (sal_uInt16 i = 0, nCount = m_xUpdates->n_children(); i < nCount; ++i)
{
UpdateDialog::Index const * p =
- reinterpret_cast< UpdateDialog::Index const * >(
- m_xUpdates->get_id(i).toInt64());
+ weld::fromId<UpdateDialog::Index const*>(m_xUpdates->get_id(i));
if (p->m_eKind == ENABLED_UPDATE && m_xUpdates->get_toggle(i) == TRISTATE_TRUE) {
m_updateData.push_back( m_enabledUpdates[ p->m_nIndex ] );
}