summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorDirk Voelzke <dv@openoffice.org>2010-07-01 08:50:48 +0200
committerDirk Voelzke <dv@openoffice.org>2010-07-01 08:50:48 +0200
commitc2af8fa19926739c6d84de8e8e73b6cfadc786ab (patch)
tree4b154c678eba41b4ad1d4285362d9a3171d3e47a /extensions
parentb4a614745a3a941c68a1c8eb215a06010d058e66 (diff)
parent273fa6a6aa0d56660807ab29892f0618cfbb2e63 (diff)
dv19: merge with DEV300_m84
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/abpilot/abpfinalpage.cxx4
-rw-r--r--extensions/source/abpilot/abpfinalpage.hxx2
-rw-r--r--extensions/source/abpilot/abspilot.cxx11
-rw-r--r--extensions/source/abpilot/abspilot.hxx2
-rw-r--r--extensions/source/abpilot/tableselectionpage.cxx2
-rw-r--r--extensions/source/abpilot/tableselectionpage.hxx2
-rw-r--r--extensions/source/abpilot/typeselectionpage.cxx9
-rw-r--r--extensions/source/abpilot/typeselectionpage.hxx2
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.cxx4
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx4
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx6
-rw-r--r--extensions/source/dbpilots/gridwizard.cxx36
-rw-r--r--extensions/source/dbpilots/gridwizard.hxx5
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx27
-rw-r--r--extensions/source/dbpilots/groupboxwiz.hxx14
-rw-r--r--extensions/source/dbpilots/listcombowizard.cxx15
-rw-r--r--extensions/source/dbpilots/listcombowizard.hxx9
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx14
-rw-r--r--extensions/source/propctrlr/pcrstrings.hxx3
-rw-r--r--extensions/source/scanner/sane.cxx5
-rw-r--r--extensions/source/update/check/download.cxx89
-rw-r--r--extensions/source/update/check/download.hxx2
-rw-r--r--extensions/source/update/check/updatecheck.cxx89
-rw-r--r--extensions/source/update/check/updatecheck.hxx2
-rw-r--r--extensions/source/update/check/updatecheckconfig.cxx2
-rw-r--r--extensions/source/update/check/updatehdl.cxx107
-rw-r--r--extensions/source/update/check/updatehdl.hrc3
-rw-r--r--extensions/source/update/check/updatehdl.hxx6
-rw-r--r--extensions/source/update/check/updatehdl.src15
29 files changed, 370 insertions, 121 deletions
diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx
index d633b597878d..2ffeb0d09739 100644
--- a/extensions/source/abpilot/abpfinalpage.cxx
+++ b/extensions/source/abpilot/abpfinalpage.cxx
@@ -141,12 +141,12 @@ namespace abp
}
//---------------------------------------------------------------------
- sal_Bool FinalPage::commitPage( CommitPageReason _eReason )
+ sal_Bool FinalPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!AddressBookSourcePage::commitPage(_eReason))
return sal_False;
- if ( ( eTravelBackward != _eReason )
+ if ( ( ::svt::WizardTypes::eTravelBackward != _eReason )
&& ( !m_aLocationController.prepareCommit() )
)
return sal_False;
diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx
index 415bc31f2bc1..27d6522d7df6 100644
--- a/extensions/source/abpilot/abpfinalpage.hxx
+++ b/extensions/source/abpilot/abpfinalpage.hxx
@@ -66,7 +66,7 @@ namespace abp
protected:
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
// TabDialog overridables
virtual void ActivatePage();
diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx
index b315893b6447..d8007873a2c4 100644
--- a/extensions/source/abpilot/abspilot.cxx
+++ b/extensions/source/abpilot/abspilot.cxx
@@ -213,14 +213,11 @@ namespace abp
}
//---------------------------------------------------------------------
- sal_Bool OAddessBookSourcePilot::onFinish(sal_Int32 _nResult)
+ sal_Bool OAddessBookSourcePilot::onFinish()
{
- if (!OAddessBookSourcePilot_Base::onFinish(_nResult))
+ if ( !OAddessBookSourcePilot_Base::onFinish() )
return sal_False;
- if (RET_OK != _nResult)
- return sal_True;
-
implCommitAll();
addressconfig::markPilotSuccess( getORB() );
@@ -283,9 +280,7 @@ namespace abp
if ( aTables.empty() )
{
- if ( ( _eReason == eValidateNoUI )
- || ( RET_YES != QueryBox( this, ModuleRes( RID_QRY_NOTABLES ) ).Execute() )
- )
+ if ( RET_YES != QueryBox( this, ModuleRes( RID_QRY_NOTABLES ) ).Execute() )
{
// cannot ask the user, or the user chose to use this data source, though there are no tables
bAllow = sal_False;
diff --git a/extensions/source/abpilot/abspilot.hxx b/extensions/source/abpilot/abspilot.hxx
index b0f3b900871b..0abdacd0281d 100644
--- a/extensions/source/abpilot/abspilot.hxx
+++ b/extensions/source/abpilot/abspilot.hxx
@@ -79,7 +79,7 @@ namespace abp
virtual ::svt::OWizardPage* createPage( WizardState _nState );
virtual void enterState( WizardState _nState );
virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
- virtual sal_Bool onFinish( sal_Int32 _nResult );
+ virtual sal_Bool onFinish();
// RoadmapWizard
virtual String getStateDisplayName( WizardState _nState ) const;
diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx
index 0cefba92ab5a..869c806ea819 100644
--- a/extensions/source/abpilot/tableselectionpage.cxx
+++ b/extensions/source/abpilot/tableselectionpage.cxx
@@ -109,7 +109,7 @@ namespace abp
}
//---------------------------------------------------------------------
- sal_Bool TableSelectionPage::commitPage( CommitPageReason _eReason )
+ sal_Bool TableSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!AddressBookSourcePage::commitPage(_eReason))
return sal_False;
diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx
index 36bc792fd0e7..d2d878c65d5f 100644
--- a/extensions/source/abpilot/tableselectionpage.hxx
+++ b/extensions/source/abpilot/tableselectionpage.hxx
@@ -51,7 +51,7 @@ namespace abp
protected:
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
// TabDialog overridables
virtual void ActivatePage();
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index 6188b7d21628..fd83630e81d9 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -207,18 +207,15 @@ namespace abp
}
//---------------------------------------------------------------------
- sal_Bool TypeSelectionPage::commitPage( CommitPageReason _eReason )
+ sal_Bool TypeSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!AddressBookSourcePage::commitPage(_eReason))
return sal_False;
if (AST_INVALID == getSelectedType( ))
{
- if ( _eReason != eValidateNoUI )
- {
- ErrorBox aError(this, ModuleRes(RID_ERR_NEEDTYPESELECTION));
- aError.Execute();
- }
+ ErrorBox aError(this, ModuleRes(RID_ERR_NEEDTYPESELECTION));
+ aError.Execute();
return sal_False;
}
diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx
index 18c8d6b9697d..9df17bb1d77f 100644
--- a/extensions/source/abpilot/typeselectionpage.hxx
+++ b/extensions/source/abpilot/typeselectionpage.hxx
@@ -83,7 +83,7 @@ namespace abp
protected:
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
// TabDialog overridables
virtual void ActivatePage();
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index 7b58c8de8560..88d8e2eb352e 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -164,7 +164,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OTableSelectionPage::commitPage( CommitPageReason _eReason )
+ sal_Bool OTableSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OControlWizardPage::commitPage(_eReason))
return sal_False;
@@ -493,7 +493,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool ODBFieldPage::commitPage( CommitPageReason _eReason )
+ sal_Bool ODBFieldPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OMaybeListSelectionPage::commitPage(_eReason))
return sal_False;
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 3cbe1ac2b514..a20587b36d72 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -64,7 +64,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
protected:
DECL_LINK( OnListboxSelection, ListBox* );
@@ -131,7 +131,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
// own overridables
virtual String& getDBFieldSetting() = 0;
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index b97eb60504b4..c5d816486ecc 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -156,7 +156,7 @@ namespace dbp
_rList.Clear();
const ::rtl::OUString* pItems = _rItems.getConstArray();
const ::rtl::OUString* pEnd = pItems + _rItems.getLength();
- WizardState nPos;
+ ::svt::WizardTypes::WizardState nPos;
sal_Int32 nIndex = 0;
for (;pItems < pEnd; ++pItems, ++nIndex)
{
@@ -172,7 +172,7 @@ namespace dbp
_rList.Clear();
const ::rtl::OUString* pItems = _rItems.getConstArray();
const ::rtl::OUString* pEnd = pItems + _rItems.getLength();
- WizardState nPos;
+ ::svt::WizardTypes::WizardState nPos;
sal_Int32 nIndex = 0;
for (;pItems < pEnd; ++pItems)
{
@@ -254,7 +254,7 @@ namespace dbp
m_pFormDatasource->SetText(sDataSource);
m_pFormTable->SetText(sCommand);
- WizardState nCommandTypeResourceId = 0;
+ ::svt::WizardTypes::WizardState nCommandTypeResourceId = 0;
switch (nCommandType)
{
case CommandType::TABLE:
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index 6e28567aef62..7606fc7bec65 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -33,6 +33,7 @@
#include <comphelper/stl_types.hxx>
#include <tools/string.hxx>
#include <com/sun/star/form/XGridColumnFactory.hpp>
+#include <com/sun/star/awt/MouseWheelBehavior.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <tools/debug.hxx>
#include "dbptools.hxx"
@@ -52,6 +53,7 @@ namespace dbp
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::form;
+ using namespace ::com::sun::star::awt;
using namespace ::svt;
//=====================================================================
@@ -111,6 +113,7 @@ namespace dbp
static const ::rtl::OUString s_sDataFieldProperty = ::rtl::OUString::createFromAscii("DataField");
static const ::rtl::OUString s_sLabelProperty = ::rtl::OUString::createFromAscii("Label");
static const ::rtl::OUString s_sWidthProperty = ::rtl::OUString::createFromAscii("Width");
+ static const ::rtl::OUString s_sMouseWheelBehavior = ::rtl::OUString::createFromAscii("MouseWheelBehavior");
static const ::rtl::OUString s_sEmptyString;
// collect "descriptors" for the to-be-created (grid)columns
@@ -202,23 +205,24 @@ namespace dbp
// create a (grid)column for the (resultset)column
try
{
- Reference< XPropertySet > xColumn = xColumnFactory->createColumn(*pColumnServiceName);
+ Reference< XPropertySet > xColumn( xColumnFactory->createColumn(*pColumnServiceName), UNO_SET_THROW );
+ Reference< XPropertySetInfo > xColumnPSI( xColumn->getPropertySetInfo(), UNO_SET_THROW );
::rtl::OUString sColumnName(*pColumnServiceName);
disambiguateName(xExistenceChecker, sColumnName);
- if (xColumn.is())
- {
- // the data field the column should be bound to
- xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName));
- // the label
- xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix));
- // the width (<void/> => column will be auto-sized)
- xColumn->setPropertyValue(s_sWidthProperty, Any());
-
- // insert the column
- xColumnContainer->insertByName(sColumnName, makeAny(xColumn));
- }
+ // the data field the column should be bound to
+ xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName));
+ // the label
+ xColumn->setPropertyValue(s_sLabelProperty, makeAny(::rtl::OUString(*pFormFieldName) += *pColumnLabelPostfix));
+ // the width (<void/> => column will be auto-sized)
+ xColumn->setPropertyValue(s_sWidthProperty, Any());
+
+ if ( xColumnPSI->hasPropertyByName( s_sMouseWheelBehavior ) )
+ xColumn->setPropertyValue( s_sMouseWheelBehavior, makeAny( MouseWheelBehavior::SCROLL_DISABLED ) );
+
+ // insert the column
+ xColumnContainer->insertByName(sColumnName, makeAny(xColumn));
}
catch(Exception&)
{
@@ -285,9 +289,9 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OGridWizard::onFinish(sal_Int32 _nResult)
+ sal_Bool OGridWizard::onFinish()
{
- if (!OControlWizard::onFinish(_nResult))
+ if ( !OControlWizard::onFinish() )
return sal_False;
implApplySettings();
@@ -362,7 +366,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OGridFieldsSelection::commitPage( CommitPageReason _eReason )
+ sal_Bool OGridFieldsSelection::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OGridPage::commitPage(_eReason))
return sal_False;
diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx
index d0f255ede729..85b91d274345 100644
--- a/extensions/source/dbpilots/gridwizard.hxx
+++ b/extensions/source/dbpilots/gridwizard.hxx
@@ -68,8 +68,7 @@ namespace dbp
virtual WizardState determineNextState( WizardState _nCurrentState ) const;
virtual void enterState( WizardState _nState );
virtual sal_Bool leaveState( WizardState _nState );
-
- virtual sal_Bool onFinish(sal_Int32 _nResult);
+ virtual sal_Bool onFinish();
virtual sal_Bool approveControl(sal_Int16 _nClassId);
@@ -114,7 +113,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
protected:
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 7bf3138bf5fe..9956cfe86428 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -79,7 +79,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- OWizardPage* OGroupBoxWizard::createPage(WizardState _nState)
+ OWizardPage* OGroupBoxWizard::createPage(::svt::WizardTypes::WizardState _nState)
{
switch (_nState)
{
@@ -106,7 +106,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- WizardTypes::WizardState OGroupBoxWizard::determineNextState( WizardState _nCurrentState ) const
+ WizardTypes::WizardState OGroupBoxWizard::determineNextState( ::svt::WizardTypes::WizardState _nCurrentState ) const
{
switch (_nCurrentState)
{
@@ -133,7 +133,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- void OGroupBoxWizard::enterState(WizardState _nState)
+ void OGroupBoxWizard::enterState(::svt::WizardTypes::WizardState _nState)
{
// some stuff to do before calling the base class (modifying our settings)
switch (_nState)
@@ -187,18 +187,15 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OGroupBoxWizard::onFinish(sal_Int32 _nResult)
+ sal_Bool OGroupBoxWizard::onFinish()
{
- if (RET_OK != _nResult)
- return OControlWizard::onFinish(_nResult);
-
// commit the basic control setttings
commitControlSettings(&m_aSettings);
// create the radio buttons
createRadios();
- return OControlWizard::onFinish(_nResult);
+ return OControlWizard::onFinish();
}
//=====================================================================
@@ -265,7 +262,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool ORadioSelectionPage::commitPage( CommitPageReason _eReason )
+ sal_Bool ORadioSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OGBWPage::commitPage(_eReason))
return sal_False;
@@ -277,7 +274,7 @@ namespace dbp
rSettings.aValues.clear();
rSettings.aLabels.reserve(m_aExistingRadios.GetEntryCount());
rSettings.aValues.reserve(m_aExistingRadios.GetEntryCount());
- for (WizardState i=0; i<m_aExistingRadios.GetEntryCount(); ++i)
+ for (::svt::WizardTypes::WizardState i=0; i<m_aExistingRadios.GetEntryCount(); ++i)
{
rSettings.aLabels.push_back(m_aExistingRadios.GetEntry(i));
rSettings.aValues.push_back(String::CreateFromInt32((sal_Int32)(i + 1)));
@@ -393,7 +390,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool ODefaultFieldSelectionPage::commitPage( CommitPageReason _eReason )
+ sal_Bool ODefaultFieldSelectionPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OMaybeListSelectionPage::commitPage(_eReason))
return sal_False;
@@ -416,7 +413,7 @@ namespace dbp
,m_aValue (this, ModuleRes(ET_OPTIONVALUE))
,m_aOptionsLabel (this, ModuleRes(FT_RADIOBUTTONS))
,m_aOptions (this, ModuleRes(LB_RADIOBUTTONS))
- ,m_nLastSelection((WizardState)-1)
+ ,m_nLastSelection((::svt::WizardTypes::WizardState)-1)
{
FreeResource();
@@ -440,7 +437,7 @@ namespace dbp
//---------------------------------------------------------------------
void OOptionValuesPage::implTraveledOptions()
{
- if ((WizardState)-1 != m_nLastSelection)
+ if ((::svt::WizardTypes::WizardState)-1 != m_nLastSelection)
{
// save the value for the last option
DBG_ASSERT((size_t)m_nLastSelection < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid previous selection index!");
@@ -480,7 +477,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OOptionValuesPage::commitPage( CommitPageReason _eReason )
+ sal_Bool OOptionValuesPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OGBWPage::commitPage(_eReason))
return sal_False;
@@ -548,7 +545,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OFinalizeGBWPage::commitPage( CommitPageReason _eReason )
+ sal_Bool OFinalizeGBWPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OGBWPage::commitPage(_eReason))
return sal_False;
diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx
index 97a2cd1a3109..de0f9767f3a4 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -73,8 +73,7 @@ namespace dbp
virtual ::svt::OWizardPage* createPage( WizardState _nState );
virtual WizardState determineNextState( WizardState _nCurrentState ) const;
virtual void enterState( WizardState _nState );
-
- virtual sal_Bool onFinish(sal_Int32 _nResult);
+ virtual sal_Bool onFinish();
virtual sal_Bool approveControl(sal_Int16 _nClassId);
@@ -117,7 +116,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
DECL_LINK( OnMoveEntry, PushButton* );
@@ -145,7 +144,7 @@ namespace dbp
protected:
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
OOptionGroupSettings& getSettings() { return static_cast<OGroupBoxWizard*>(getDialog())->getSettings(); }
};
@@ -164,7 +163,8 @@ namespace dbp
ListBox m_aOptions;
StringArray m_aUncommittedValues;
- WizardState m_nLastSelection;
+ ::svt::WizardTypes::WizardState
+ m_nLastSelection;
public:
OOptionValuesPage( OControlWizard* _pParent );
@@ -175,7 +175,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
void implTraveledOptions();
@@ -217,7 +217,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
};
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index 2e810654baa4..bf3f56781d63 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -226,14 +226,11 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OListComboWizard::onFinish(sal_Int32 _nResult)
+ sal_Bool OListComboWizard::onFinish()
{
- if (!OControlWizard::onFinish(_nResult))
+ if ( !OControlWizard::onFinish() )
return sal_False;
- if (RET_OK != _nResult)
- return sal_True;
-
implApplySettings();
return sal_True;
}
@@ -362,14 +359,14 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OContentTableSelection::commitPage( CommitPageReason _eReason )
+ sal_Bool OContentTableSelection::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OLCPage::commitPage(_eReason))
return sal_False;
OListComboSettings& rSettings = getSettings();
rSettings.sListContentTable = m_aSelectTable.GetSelectEntry();
- if (!rSettings.sListContentTable.Len() && (eTravelBackward != _eReason))
+ if (!rSettings.sListContentTable.Len() && (::svt::WizardTypes::eTravelBackward != _eReason))
// need to select a table
return sal_False;
@@ -440,7 +437,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OContentFieldSelection::commitPage( CommitPageReason _eReason )
+ sal_Bool OContentFieldSelection::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OLCPage::commitPage(_eReason))
return sal_False;
@@ -518,7 +515,7 @@ namespace dbp
}
//---------------------------------------------------------------------
- sal_Bool OLinkFieldsPage::commitPage( CommitPageReason _eReason )
+ sal_Bool OLinkFieldsPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
if (!OLCPage::commitPage(_eReason))
return sal_False;
diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx
index 7dcf32316236..05f7f70ea65d 100644
--- a/extensions/source/dbpilots/listcombowizard.hxx
+++ b/extensions/source/dbpilots/listcombowizard.hxx
@@ -80,8 +80,7 @@ namespace dbp
virtual WizardState determineNextState( WizardState _nCurrentState ) const;
virtual void enterState( WizardState _nState );
virtual sal_Bool leaveState( WizardState _nState );
-
- virtual sal_Bool onFinish(sal_Int32 _nResult);
+ virtual sal_Bool onFinish();
virtual sal_Bool approveControl(sal_Int16 _nClassId);
@@ -129,7 +128,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
protected:
@@ -163,7 +162,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
};
@@ -190,7 +189,7 @@ namespace dbp
// OWizardPage overridables
virtual void initializePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
private:
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index 5c3fdba085c3..282130daea0b 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -594,7 +594,7 @@ namespace pcr
}
catch( const Exception& )
{
- OSL_ENSURE( false, "EventHandler::EventHandler: caught an exception while classifying the component!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -825,7 +825,7 @@ namespace pcr
}
catch( const Exception& )
{
- DBG_ERROR( "EventHandler::getSupportedProperties: caught an exception !" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1048,7 +1048,7 @@ namespace pcr
}
catch( const Exception& )
{
- OSL_ENSURE( false, "EventHandler::impl_getFormComponentScriptEvents_nothrow: caught an exception!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1080,7 +1080,7 @@ namespace pcr
}
catch( const Exception& )
{
- OSL_ENSURE( false, "EventHandler::impl_getCopmonentListenerTypes_nothrow: caught an exception!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1105,7 +1105,7 @@ namespace pcr
}
catch( const Exception& )
{
- OSL_ENSURE( false, "EventHandler::impl_getDialogElementScriptEvents_nothrow: caught an exception!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1120,7 +1120,7 @@ namespace pcr
{
Reference< XTabControllerModel > xComponentAsTCModel( m_xComponent, UNO_QUERY_THROW );
Reference< XFormController > xController(
- m_aContext.createComponent( (const rtl::OUString&)SERVICE_FORMCONTROLLER ), UNO_QUERY_THROW );
+ m_aContext.createComponent( "com.sun.star.form.runtime.FormController" ), UNO_QUERY_THROW );
xController->setModel( xComponentAsTCModel );
xReturn = xController;
@@ -1212,7 +1212,7 @@ namespace pcr
}
catch( const Exception& )
{
- OSL_ENSURE( false, "EventHandler::impl_setFormComponentScriptEvent_nothrow: caught an exception!" );
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/extensions/source/propctrlr/pcrstrings.hxx b/extensions/source/propctrlr/pcrstrings.hxx
index 9a611f5fce7f..e2a81c9920ca 100644
--- a/extensions/source/propctrlr/pcrstrings.hxx
+++ b/extensions/source/propctrlr/pcrstrings.hxx
@@ -38,9 +38,6 @@ namespace pcr
// properties
PCR_CONSTASCII_STRING( PROPERTY_TABBINGMODEL, "TabbingModel" );
- // services
- PCR_CONSTASCII_STRING( SERVICE_FORMCONTROLLER, "com.sun.star.form.FormController" );
-
//............................................................................
} // namespace pcr
//............................................................................
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index af1a8d91c8fd..43c50e6f8451 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -642,6 +642,11 @@ BOOL Sane::Start( BitmapTransporter& rBitmap )
nStatus = p_get_parameters( maHandle, &aParams );
DUMP_STATE( nStatus, "sane_get_parameters" );
CheckConsistency( "sane_get_parameters" );
+ if (nStatus != SANE_STATUS_GOOD || aParams.bytes_per_line == 0)
+ {
+ bSuccess = FALSE;
+ break;
+ }
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
const char* ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
"SANE_FRAME_RED", "SANE_FRAME_GREEN",
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx
index dd7da492ff57..09d90f1eaa83 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -169,7 +169,9 @@ progress_callback( void *clientp, double dltotal, double dlnow, double ultotal,
if( ! out->StopCondition.check() )
{
- double fPercent = (dlnow + out->Offset) * 100 / (dltotal + out->Offset);
+ double fPercent = 0;
+ if ( dltotal + out->Offset )
+ fPercent = (dlnow + out->Offset) * 100 / (dltotal + out->Offset);
if( fPercent < 0 )
fPercent = 0;
@@ -262,6 +264,9 @@ bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProx
rtl::OString aURL(rtl::OUStringToOString(rURL, RTL_TEXTENCODING_UTF8));
curl_easy_setopt(pCURL, CURLOPT_URL, aURL.getStr());
+ // abort on http errors
+ curl_easy_setopt(pCURL, CURLOPT_FAILONERROR, 1);
+
// enable redirection
curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1);
@@ -300,6 +305,19 @@ bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProx
ret = true;
}
+ if ( CURLE_PARTIAL_FILE == cc )
+ {
+ // this sometimes happens, when a user throws away his user data, but has already
+ // completed the download of an update.
+ double fDownloadSize;
+ curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &fDownloadSize );
+ if ( -1 == fDownloadSize )
+ {
+ out.Handler->downloadFinished(out.File);
+ ret = true;
+ }
+ }
+
// Avoid target file being removed
else if( (CURLE_ABORTED_BY_CALLBACK == cc) || out.StopCondition.check() )
ret = true;
@@ -313,7 +331,30 @@ bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProx
if( NULL != error_message )
aMessage = error_message;
- out.Handler->downloadStalled( rtl::OStringToOUString(aMessage, RTL_TEXTENCODING_UTF8) );
+ if ( CURLE_HTTP_RETURNED_ERROR == cc )
+ {
+ long nError;
+ curl_easy_getinfo( pCURL, CURLINFO_RESPONSE_CODE, &nError );
+
+ if ( 403 == nError )
+ aMessage += rtl::OString( RTL_CONSTASCII_STRINGPARAM( " 403: Access denied!" ) );
+ else if ( 404 == nError )
+ aMessage += rtl::OString( RTL_CONSTASCII_STRINGPARAM( " 404: File not found!" ) );
+ else if ( 416 == nError )
+ {
+ // we got this error probably, because we already downloaded the file
+ out.Handler->downloadFinished(out.File);
+ ret = true;
+ }
+ else
+ {
+ aMessage += rtl::OString( RTL_CONSTASCII_STRINGPARAM( ":error code = " ) );
+ aMessage += aMessage.valueOf( nError );
+ aMessage += rtl::OString( RTL_CONSTASCII_STRINGPARAM( " !" ) );
+ }
+ }
+ if ( !ret )
+ out.Handler->downloadStalled( rtl::OStringToOUString(aMessage, RTL_TEXTENCODING_UTF8) );
}
curl_easy_cleanup(pCURL);
@@ -330,14 +371,52 @@ Download::start(const rtl::OUString& rURL, const rtl::OUString& rFile, const rtl
OSL_ASSERT( m_aHandler.is() );
OutData out(m_aCondition);
+ rtl::OUString aFile( rFile );
+
+ // when rFile is empty, there is no remembered file name. If there is already a file with the
+ // same name ask the user if she wants to resume a download or restart the download
+ if ( !aFile.getLength() )
+ {
+ // GetFileName()
+ rtl::OUString aURL( rURL );
+ // ensure no trailing '/'
+ sal_Int32 nLen = aURL.getLength();
+ while( (nLen > 0) && ('/' == aURL[ nLen-1 ]) )
+ aURL = aURL.copy( 0, --nLen );
+
+ // extract file name last '/'
+ sal_Int32 nIndex = aURL.lastIndexOf('/');
+ aFile = rDestinationDir + aURL.copy( nIndex );
+
+ // check for existing file
+ oslFileError rc = osl_openFile( aFile.pData, &out.FileHandle, osl_File_OpenFlag_Write | osl_File_OpenFlag_Create );
+ osl_closeFile(out.FileHandle);
+ out.FileHandle = NULL;
+
+ if( osl_File_E_EXIST == rc )
+ {
+ if ( m_aHandler->checkDownloadDestination( aURL.copy( nIndex+1 ) ) )
+ {
+ osl_removeFile( aFile.pData );
+ aFile = rtl::OUString();
+ }
+ else
+ m_aHandler->downloadStarted( aFile, 0 );
+ }
+ else
+ {
+ osl_removeFile( aFile.pData );
+ aFile = rtl::OUString();
+ }
+ }
- out.File = rFile;
+ out.File = aFile;
out.DestinationDir = rDestinationDir;
out.Handler = m_aHandler;
- if( rFile.getLength() > 0 )
+ if( aFile.getLength() > 0 )
{
- oslFileError rc = osl_openFile(rFile.pData, &out.FileHandle, osl_File_OpenFlag_Write);
+ oslFileError rc = osl_openFile(aFile.pData, &out.FileHandle, osl_File_OpenFlag_Write);
if( osl_File_E_None == rc )
{
diff --git a/extensions/source/update/check/download.hxx b/extensions/source/update/check/download.hxx
index 1b2fb678417b..ff16ef52f7fb 100644
--- a/extensions/source/update/check/download.hxx
+++ b/extensions/source/update/check/download.hxx
@@ -35,6 +35,8 @@
struct DownloadInteractionHandler : public rtl::IReference
{
+ virtual bool checkDownloadDestination(const rtl::OUString& rFileName) = 0;
+
// called if the destination file already exists, but resume is false
virtual bool downloadTargetExists(const rtl::OUString& rFileName) = 0;
diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx
index 10632cd23fbd..8419569bd949 100644
--- a/extensions/source/update/check/updatecheck.cxx
+++ b/extensions/source/update/check/updatecheck.cxx
@@ -800,6 +800,8 @@ UpdateCheck::initialize(const uno::Sequence< beans::NamedValue >& rValues,
aModel.getUpdateEntry(m_aUpdateInfo);
bool obsoleteUpdateInfo = isObsoleteUpdateInfo(aUpdateEntryVersion);
+ bool bContinueDownload = false;
+ bool bDownloadAvailable = false;
m_bHasExtensionUpdate = checkForPendingUpdates( xContext );
m_bShowExtUpdDlg = false;
@@ -808,10 +810,7 @@ UpdateCheck::initialize(const uno::Sequence< beans::NamedValue >& rValues,
if( aLocalFileName.getLength() > 0 )
{
- bool downloadPaused = aModel.isDownloadPaused();
-
- enableDownload(true, downloadPaused);
- setUIState(downloadPaused ? UPDATESTATE_DOWNLOAD_PAUSED : UPDATESTATE_DOWNLOADING);
+ bContinueDownload = true;
// Try to get the number of bytes already on disk
osl::DirectoryItem aDirectoryItem;
@@ -820,16 +819,36 @@ UpdateCheck::initialize(const uno::Sequence< beans::NamedValue >& rValues,
osl::FileStatus aFileStatus(FileStatusMask_FileSize);
if( osl::DirectoryItem::E_None == aDirectoryItem.getFileStatus(aFileStatus) )
{
- // Calculate initial percent value.
- if( aModel.getDownloadSize() > 0 )
+ sal_Int64 nDownloadSize = aModel.getDownloadSize();
+ sal_Int64 nFileSize = aFileStatus.getFileSize();
+
+ if( nDownloadSize > 0 )
{
- sal_Int32 nPercent = (sal_Int32) (100 * aFileStatus.getFileSize() / aModel.getDownloadSize());
- getUpdateHandler()->setProgress(nPercent);
+ if ( nDownloadSize <= nFileSize ) // we have already downloaded everthing
+ {
+ bContinueDownload = false;
+ bDownloadAvailable = true;
+ m_aImageName = getImageFromFileName( aLocalFileName );
+ }
+ else // Calculate initial percent value.
+ {
+ sal_Int32 nPercent = (sal_Int32) (100 * nFileSize / nDownloadSize);
+ getUpdateHandler()->setProgress( nPercent );
+ }
}
}
}
+
+ if ( bContinueDownload )
+ {
+ bool downloadPaused = aModel.isDownloadPaused();
+
+ enableDownload(true, downloadPaused);
+ setUIState(downloadPaused ? UPDATESTATE_DOWNLOAD_PAUSED : UPDATESTATE_DOWNLOADING);
+ }
+
}
- else
+ if ( !bContinueDownload )
{
// We do this intentionally only if no download is in progress ..
if( obsoleteUpdateInfo )
@@ -842,13 +861,21 @@ UpdateCheck::initialize(const uno::Sequence< beans::NamedValue >& rValues,
// Data is outdated, probably due to installed update
rtl::Reference< UpdateCheckConfig > aConfig = UpdateCheckConfig::get( xContext, *this );
aConfig->clearUpdateFound();
+ aConfig->clearLocalFileName();
+
m_aUpdateInfo = UpdateInfo();
+ // Remove outdated release notes
+ storeReleaseNote( 1, rtl::OUString() );
+ storeReleaseNote( 2, rtl::OUString() );
}
else
{
enableAutoCheck(aModel.isAutoCheckEnabled());
- setUIState(getUIState(m_aUpdateInfo));
+ if ( bDownloadAvailable )
+ setUIState( UPDATESTATE_DOWNLOAD_AVAIL );
+ else
+ setUIState(getUIState(m_aUpdateInfo));
}
}
}
@@ -937,6 +964,10 @@ UpdateCheck::install()
aParameter += UNISTRING(" &");
#endif
+
+ rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext );
+ rModel->clearLocalFileName();
+
xShellExecute->execute(aInstallImage, aParameter, nFlags);
ShutdownThread *pShutdownThread = new ShutdownThread( m_xContext );
(void) pShutdownThread;
@@ -1102,6 +1133,23 @@ UpdateCheck::downloadTargetExists(const rtl::OUString& rFileName)
}
//------------------------------------------------------------------------------
+bool UpdateCheck::checkDownloadDestination( const rtl::OUString& rFileName )
+{
+ osl::ClearableMutexGuard aGuard(m_aMutex);
+
+ rtl::Reference< UpdateHandler > aUpdateHandler( getUpdateHandler() );
+
+ bool bReload = false;
+
+ if( aUpdateHandler->isVisible() )
+ {
+ bReload = aUpdateHandler->showOverwriteWarning( rFileName );
+ }
+
+ return bReload;
+}
+
+//------------------------------------------------------------------------------
void
UpdateCheck::downloadStalled(const rtl::OUString& rErrorMessage)
@@ -1132,15 +1180,18 @@ UpdateCheck::downloadProgressAt(sal_Int8 nPercent)
void
UpdateCheck::downloadStarted(const rtl::OUString& rLocalFileName, sal_Int64 nFileSize)
{
- osl::MutexGuard aGuard(m_aMutex);
+ if ( nFileSize > 0 )
+ {
+ osl::MutexGuard aGuard(m_aMutex);
- rtl::Reference< UpdateCheckConfig > aModel(UpdateCheckConfig::get(m_xContext));
- aModel->storeLocalFileName(rLocalFileName, nFileSize);
+ rtl::Reference< UpdateCheckConfig > aModel(UpdateCheckConfig::get(m_xContext));
+ aModel->storeLocalFileName(rLocalFileName, nFileSize);
- // Bring-up release note for position 1 ..
- const rtl::OUString aURL(getReleaseNote(m_aUpdateInfo, 1, aModel->isAutoDownloadEnabled()));
- if( aURL.getLength() > 0 )
- showReleaseNote(aURL);
+ // Bring-up release note for position 1 ..
+ const rtl::OUString aURL(getReleaseNote(m_aUpdateInfo, 1, aModel->isAutoDownloadEnabled()));
+ if( aURL.getLength() > 0 )
+ showReleaseNote(aURL);
+ }
}
//------------------------------------------------------------------------------
@@ -1153,9 +1204,6 @@ UpdateCheck::downloadFinished(const rtl::OUString& rLocalFileName)
// no more retries
m_pThread->terminate();
- rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get(m_xContext);
- rModel->clearLocalFileName();
-
m_aImageName = getImageFromFileName(rLocalFileName);
UpdateInfo aUpdateInfo(m_aUpdateInfo);
@@ -1163,6 +1211,7 @@ UpdateCheck::downloadFinished(const rtl::OUString& rLocalFileName)
setUIState(UPDATESTATE_DOWNLOAD_AVAIL);
// Bring-up release note for position 2 ..
+ rtl::Reference< UpdateCheckConfig > rModel = UpdateCheckConfig::get( m_xContext );
const rtl::OUString aURL(getReleaseNote(aUpdateInfo, 2, rModel->isAutoDownloadEnabled()));
if( aURL.getLength() > 0 )
showReleaseNote(aURL);
diff --git a/extensions/source/update/check/updatecheck.hxx b/extensions/source/update/check/updatecheck.hxx
index 59a1727f4bd9..7283288769e0 100644
--- a/extensions/source/update/check/updatecheck.hxx
+++ b/extensions/source/update/check/updatecheck.hxx
@@ -111,6 +111,8 @@ public:
virtual void downloadProgressAt(sal_Int8 nProcent);
virtual void downloadStarted(const rtl::OUString& rLocalFileName, sal_Int64 nFileSize);
virtual void downloadFinished(const rtl::OUString& rLocalFileName);
+ // checks if the download target already exists and asks user what to do next
+ virtual bool checkDownloadDestination( const rtl::OUString& rFile );
// Cancels the download action (and resumes checking if enabled)
void cancelDownload();
diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx
index b3e559c5f136..9f78b33270c2 100644
--- a/extensions/source/update/check/updatecheckconfig.cxx
+++ b/extensions/source/update/check/updatecheckconfig.cxx
@@ -398,7 +398,7 @@ UpdateCheckConfig::storeLocalFileName(const rtl::OUString& rLocalFileName, sal_I
if( m_xContainer->hasByName(aNameList[i]) )
m_xContainer->replaceByName(aNameList[i], aValueList[i]);
else
- m_xContainer->insertByName(aNameList[i],aValueList[i]);
+ m_xContainer->insertByName(aNameList[i], aValueList[i]);
}
commitChanges();
diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx
index cd1c5f1f721a..bb38c34a0b4e 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -52,6 +52,7 @@
#include "com/sun/star/awt/XThrobber.hpp"
#include "com/sun/star/awt/XTopWindow.hpp"
#include "com/sun/star/awt/XVclWindowPeer.hpp"
+#include "com/sun/star/awt/XVclContainer.hpp"
#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/awt/XWindow2.hpp"
@@ -101,7 +102,8 @@ UpdateHandler::UpdateHandler( const uno::Reference< uno::XComponentContext > & r
mbVisible( false ),
mbStringsLoaded( false ),
mbMinimized( false ),
- mbListenerAdded(false)
+ mbListenerAdded(false),
+ mbShowsMessageBox(false)
{
}
@@ -232,6 +234,11 @@ void UpdateHandler::setVisible( bool bVisible )
//--------------------------------------------------------------------
void UpdateHandler::setProgress( sal_Int32 nPercent )
{
+ if ( nPercent > 100 )
+ nPercent = 100;
+ else if ( nPercent < 0 )
+ nPercent = 0;
+
if ( nPercent != mnPercent )
{
osl::MutexGuard aGuard( maMutex );
@@ -478,7 +485,18 @@ void SAL_CALL UpdateHandler::handle( uno::Reference< task::XInteractionRequest >
void SAL_CALL UpdateHandler::queryTermination( const lang::EventObject& )
throw ( frame::TerminationVetoException, uno::RuntimeException )
{
- setVisible( false );
+ if ( mbShowsMessageBox )
+ {
+ uno::Reference< awt::XTopWindow > xTopWindow( mxUpdDlg, uno::UNO_QUERY );
+ if ( xTopWindow.is() )
+ xTopWindow->toFront();
+
+ throw frame::TerminationVetoException(
+ UNISTRING("The office cannot be closed while displaying a warning!"),
+ uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY));
+ }
+ else
+ setVisible( false );
}
//------------------------------------------------------------------------------
@@ -707,6 +725,9 @@ void UpdateHandler::loadStrings()
msInstallError = loadString( xBundle, RID_UPDATE_STR_INSTALL_ERROR );
msOverwriteWarning = loadString( xBundle, RID_UPDATE_STR_OVERWRITE_WARNING );
msPercent = loadString( xBundle, RID_UPDATE_STR_PERCENT );
+ msReloadWarning = loadString( xBundle, RID_UPDATE_STR_RELOAD_WARNING );
+ msReloadReload = loadString( xBundle, RID_UPDATE_STR_RELOAD_RELOAD );
+ msReloadContinue = loadString( xBundle, RID_UPDATE_STR_RELOAD_CONTINUE );
msStatusFL = loadString( xBundle, RID_UPDATE_FT_STATUS );
msDescription = loadString( xBundle, RID_UPDATE_FT_DESCRIPTION );
@@ -943,12 +964,14 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText ) const
uno::Reference< awt::XMessageBox > xMsgBox( xToolkit->createWindow( aDescriptor ), uno::UNO_QUERY );
if ( xMsgBox.is() )
{
+ mbShowsMessageBox = true;
sal_Int16 nRet;
// xMsgBox->setCaptionText( msCancelTitle );
xMsgBox->setMessageText( rWarningText );
nRet = xMsgBox->execute();
if ( nRet == 2 ) // RET_YES == 2
bRet = true;
+ mbShowsMessageBox = false;
}
uno::Reference< lang::XComponent > xComponent( xMsgBox, uno::UNO_QUERY );
@@ -959,6 +982,86 @@ bool UpdateHandler::showWarning( const rtl::OUString &rWarningText ) const
}
//--------------------------------------------------------------------
+bool UpdateHandler::showWarning( const rtl::OUString &rWarningText,
+ const rtl::OUString &rBtnText_1,
+ const rtl::OUString &rBtnText_2 ) const
+{
+ bool bRet = false;
+
+ uno::Reference< awt::XControl > xControl( mxUpdDlg, uno::UNO_QUERY );
+ if ( !xControl.is() ) return bRet;
+
+ uno::Reference< awt::XWindowPeer > xPeer = xControl->getPeer();
+ if ( !xPeer.is() ) return bRet;
+
+ uno::Reference< awt::XToolkit > xToolkit = xPeer->getToolkit();
+ if ( !xToolkit.is() ) return bRet;
+
+ awt::WindowDescriptor aDescriptor;
+
+ sal_Int32 nWindowAttributes = awt::WindowAttribute::BORDER | awt::WindowAttribute::MOVEABLE | awt::WindowAttribute::CLOSEABLE;
+ nWindowAttributes |= awt::VclWindowPeerAttribute::YES_NO;
+ nWindowAttributes |= awt::VclWindowPeerAttribute::DEF_NO;
+
+ aDescriptor.Type = awt::WindowClass_MODALTOP;
+ aDescriptor.WindowServiceName = UNISTRING( "warningbox" );
+ aDescriptor.ParentIndex = -1;
+ aDescriptor.Parent = xPeer;
+ aDescriptor.Bounds = awt::Rectangle( 10, 10, 250, 150 );
+ aDescriptor.WindowAttributes = nWindowAttributes;
+
+ uno::Reference< awt::XMessageBox > xMsgBox( xToolkit->createWindow( aDescriptor ), uno::UNO_QUERY );
+ if ( xMsgBox.is() )
+ {
+ uno::Reference< awt::XVclContainer > xMsgBoxCtrls( xMsgBox, uno::UNO_QUERY );
+ if ( xMsgBoxCtrls.is() )
+ {
+ uno::Sequence< uno::Reference< awt::XWindow > > xChildren = xMsgBoxCtrls->getWindows();
+
+ for ( long i=0; i < xChildren.getLength(); i++ )
+ {
+ uno::Reference< awt::XVclWindowPeer > xMsgBoxCtrl( xChildren[i], uno::UNO_QUERY );
+ if ( xMsgBoxCtrl.is() )
+ {
+ bool bIsDefault = true;
+ uno::Any aValue = xMsgBoxCtrl->getProperty( UNISTRING("DefaultButton") );
+ aValue >>= bIsDefault;
+ if ( bIsDefault )
+ xMsgBoxCtrl->setProperty( UNISTRING("Text"), uno::Any( rBtnText_1 ) );
+ else
+ xMsgBoxCtrl->setProperty( UNISTRING("Text"), uno::Any( rBtnText_2 ) );
+ }
+ }
+ }
+
+ sal_Int16 nRet;
+ // xMsgBox->setCaptionText( msCancelTitle );
+ mbShowsMessageBox = true;
+ xMsgBox->setMessageText( rWarningText );
+ nRet = xMsgBox->execute();
+ if ( nRet == 2 ) // RET_YES == 2
+ bRet = true;
+
+ mbShowsMessageBox = false;
+ }
+
+ uno::Reference< lang::XComponent > xComponent( xMsgBox, uno::UNO_QUERY );
+ if ( xComponent.is() )
+ xComponent->dispose();
+
+ return bRet;
+}
+
+//--------------------------------------------------------------------
+bool UpdateHandler::showOverwriteWarning( const rtl::OUString& rFileName ) const
+{
+ rtl::OUString aMsg( msReloadWarning );
+ searchAndReplaceAll( aMsg, UNISTRING( "%FILENAME" ), rFileName );
+ searchAndReplaceAll( aMsg, UNISTRING( "%DOWNLOAD_PATH" ), msDownloadPath );
+ return showWarning( aMsg, msReloadContinue, msReloadReload );
+}
+
+//--------------------------------------------------------------------
bool UpdateHandler::showOverwriteWarning() const
{
return showWarning( msOverwriteWarning );
diff --git a/extensions/source/update/check/updatehdl.hrc b/extensions/source/update/check/updatehdl.hrc
index 6389a661bf6c..ad3d472eaf68 100644
--- a/extensions/source/update/check/updatehdl.hrc
+++ b/extensions/source/update/check/updatehdl.hrc
@@ -47,6 +47,9 @@
#define RID_UPDATE_STR_PERCENT RID_UPDATE_HDL_START + 18
#define RID_UPDATE_STR_DOWNLOAD_DESCR RID_UPDATE_HDL_START + 19
#define RID_UPDATE_STR_INSTALL_ERROR RID_UPDATE_HDL_START + 20
+ #define RID_UPDATE_STR_RELOAD_WARNING RID_UPDATE_HDL_START + 21
+ #define RID_UPDATE_STR_RELOAD_RELOAD RID_UPDATE_HDL_START + 22
+ #define RID_UPDATE_STR_RELOAD_CONTINUE RID_UPDATE_HDL_START + 23
#define RID_UPDATE_FT_DESCRIPTION RID_UPDATE_HDL_START + 25
#define RID_UPDATE_FT_STATUS RID_UPDATE_HDL_START + 26
diff --git a/extensions/source/update/check/updatehdl.hxx b/extensions/source/update/check/updatehdl.hxx
index 696e2cdda0cf..bd525853dda1 100644
--- a/extensions/source/update/check/updatehdl.hxx
+++ b/extensions/source/update/check/updatehdl.hxx
@@ -98,6 +98,7 @@ private:
bool mbStringsLoaded;
bool mbMinimized;
bool mbListenerAdded;
+ mutable bool mbShowsMessageBox;
osl::Mutex maMutex;
@@ -125,6 +126,9 @@ private:
rtl::OUString msInstallError; // RID_UPDATE_STR_INSTALL_ERROR
rtl::OUString msOverwriteWarning; // RID_UPDATE_STR_OVERWRITE_WARNING
rtl::OUString msPercent; // RID_UPDATE_STR_PERCENT
+ rtl::OUString msReloadWarning; // RID_UPDATE_STR_OVERWRITE_WARNING
+ rtl::OUString msReloadReload; // RID_UPDATE_STR_OVERWRITE_WARNING
+ rtl::OUString msReloadContinue; // RID_UPDATE_STR_OVERWRITE_WARNING
rtl::OUString msStatusFL; // RID_UPDATE_FT_STATUS
rtl::OUString msDescription; // RID_UPDATE_FT_DESCRIPTION
rtl::OUString msClose; // RID_UPDATE_BTN_CLOSE
@@ -184,6 +188,8 @@ public:
rtl::OUString getBubbleTitle( UpdateState eState );
rtl::OUString getDefaultInstErrMsg();
bool showWarning( const rtl::OUString &rWarning ) const;
+ bool showWarning( const rtl::OUString &rWarning, const rtl::OUString& rBtnText_1, const rtl::OUString& rBtnText_2 ) const;
+ bool showOverwriteWarning( const rtl::OUString &rFileName ) const;
bool showOverwriteWarning() const;
// Allows runtime exceptions to be thrown by const methods
diff --git a/extensions/source/update/check/updatehdl.src b/extensions/source/update/check/updatehdl.src
index d371a80b33cb..58f88b7e4852 100644
--- a/extensions/source/update/check/updatehdl.src
+++ b/extensions/source/update/check/updatehdl.src
@@ -122,6 +122,21 @@ String RID_UPDATE_STR_OVERWRITE_WARNING
Text [ en-US ] = "A file with that name already exists! Do you want to overwrite the existing file?";
};
+String RID_UPDATE_STR_RELOAD_WARNING
+{
+ Text [ en-US ] = "A file with the name '%FILENAME' already exists in '%DOWNLOAD_PATH'! Do you want to continue with the download or delete and reload the file?";
+};
+
+String RID_UPDATE_STR_RELOAD_RELOAD
+{
+ Text [ en-US ] = "Reload File";
+};
+
+String RID_UPDATE_STR_RELOAD_CONTINUE
+{
+ Text [ en-US ] = "Continue";
+};
+
String RID_UPDATE_STR_PERCENT
{
Text [ en-US ] = "%PERCENT%";