summaryrefslogtreecommitdiff
path: root/desktop/source/migration
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/migration')
-rw-r--r--desktop/source/migration/pages.cxx32
-rw-r--r--desktop/source/migration/pages.hxx18
-rw-r--r--desktop/source/migration/services/oo3extensionmigration.cxx4
-rwxr-xr-xdesktop/source/migration/services/wordbookmigration.cxx2
-rw-r--r--desktop/source/migration/wizard.cxx60
-rw-r--r--desktop/source/migration/wizard.hrc1
-rw-r--r--desktop/source/migration/wizard.hxx7
-rw-r--r--desktop/source/migration/wizard.src7
8 files changed, 42 insertions, 89 deletions
diff --git a/desktop/source/migration/pages.cxx b/desktop/source/migration/pages.cxx
index 53ec488c2082..eefb529d0ca7 100644
--- a/desktop/source/migration/pages.cxx
+++ b/desktop/source/migration/pages.cxx
@@ -225,7 +225,7 @@ IMPL_LINK( LicensePage, PageDownHdl, PushButton *, EMPTYARG )
IMPL_LINK( LicensePage, EndReachedHdl, LicenseView *, EMPTYARG )
{
- m_bLicenseRead = TRUE;
+ m_bLicenseRead = sal_True;
updateDialogTravelUI();
return 0;
}
@@ -259,20 +259,20 @@ void LicenseView::ScrollDown( ScrollType eScroll )
pScroll->DoScrollAction( eScroll );
}
-BOOL LicenseView::IsEndReached() const
+sal_Bool LicenseView::IsEndReached() const
{
- BOOL bEndReached;
+ sal_Bool bEndReached;
ExtTextView* pView = GetTextView();
ExtTextEngine* pEdit = GetTextEngine();
- ULONG nHeight = pEdit->GetTextHeight();
+ sal_uLong nHeight = pEdit->GetTextHeight();
Size aOutSize = pView->GetWindow()->GetOutputSizePixel();
Point aBottom( 0, aOutSize.Height() );
- if ( (ULONG) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 )
- bEndReached = TRUE;
+ if ( (sal_uLong) pView->GetDocPos( aBottom ).Y() >= nHeight - 1 )
+ bEndReached = sal_True;
else
- bEndReached = FALSE;
+ bEndReached = sal_False;
return bEndReached;
}
@@ -281,8 +281,8 @@ void LicenseView::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( rHint.IsA( TYPE(TextHint) ) )
{
- BOOL bLastVal = EndReached();
- ULONG nId = ((const TextHint&)rHint).GetId();
+ sal_Bool bLastVal = EndReached();
+ sal_uLong nId = ((const TextHint&)rHint).GetId();
if ( nId == TEXT_HINT_PARAINSERTED )
{
@@ -339,14 +339,13 @@ void MigrationThread::onTerminated()
MigrationPage::MigrationPage(
svt::OWizardMachine* parent,
- const ResId& resid,
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber)
+ const ResId& resid, Throbber& i_throbber )
: OWizardPage(parent, resid)
, m_ftHead(this, WizardResId(FT_MIGRATION_HEADER))
, m_ftBody(this, WizardResId(FT_MIGRATION_BODY))
, m_cbMigration(this, WizardResId(CB_MIGRATION))
+ , m_rThrobber(i_throbber)
, m_bMigrationDone(sal_False)
- , m_xThrobber(xThrobber)
{
FreeResource();
_setBold(m_ftHead);
@@ -366,9 +365,8 @@ sal_Bool MigrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason
if ( pWizard )
pWizard->DisableButtonsWhileMigration();
- uno::Reference< awt::XWindow > xWin( m_xThrobber, uno::UNO_QUERY );
- xWin->setVisible( true );
- m_xThrobber->start();
+ m_rThrobber.Show();
+ m_rThrobber.start();
MigrationThread* pMigThread = new MigrationThread();
pMigThread->create();
@@ -377,10 +375,10 @@ sal_Bool MigrationPage::commitPage( svt::WizardTypes::CommitPageReason _eReason
Application::Reschedule();
}
- m_xThrobber->stop();
+ m_rThrobber.stop();
GetParent()->LeaveWait();
// Next state will enable buttons - so no EnableButtons necessary!
- xWin->setVisible( false );
+ m_rThrobber.Hide();
pMigThread->join();
delete pMigThread;
m_bMigrationDone = sal_True;
diff --git a/desktop/source/migration/pages.hxx b/desktop/source/migration/pages.hxx
index 776268eb475c..47eae23ff58c 100644
--- a/desktop/source/migration/pages.hxx
+++ b/desktop/source/migration/pages.hxx
@@ -29,17 +29,15 @@
#define _PAGES_HXX_
#include <vcl/tabpage.hxx>
-#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/scrbar.hxx>
+#include <vcl/throbber.hxx>
#include <svtools/wizardmachine.hxx>
#include <svtools/svmedit.hxx>
#include <svl/lstner.hxx>
#include <svtools/xtextedt.hxx>
-#include <com/sun/star/awt/XThrobber.hpp>
-
namespace desktop
{
class WelcomePage : public svt::OWizardPage
@@ -66,7 +64,7 @@ protected:
class LicenseView : public MultiLineEdit, public SfxListener
{
- BOOL mbEndReached;
+ sal_Bool mbEndReached;
Link maEndReachedHdl;
Link maScrolledHdl;
@@ -76,9 +74,9 @@ public:
void ScrollDown( ScrollType eScroll );
- BOOL IsEndReached() const;
- BOOL EndReached() const { return mbEndReached; }
- void SetEndReached( BOOL bEnd ) { mbEndReached = bEnd; }
+ sal_Bool IsEndReached() const;
+ sal_Bool EndReached() const { return mbEndReached; }
+ void SetEndReached( sal_Bool bEnd ) { mbEndReached = bEnd; }
void SetEndReachedHdl( const Link& rHdl ) { maEndReachedHdl = rHdl; }
const Link& GetAutocompleteHdl() const { return maEndReachedHdl; }
@@ -120,11 +118,11 @@ class MigrationPage : public svt::OWizardPage
private:
FixedText m_ftHead;
FixedText m_ftBody;
- CheckBox m_cbMigration;
+ CheckBox m_cbMigration;
+ Throbber& m_rThrobber;
sal_Bool m_bMigrationDone;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
public:
- MigrationPage( svt::OWizardMachine* parent, const ResId& resid, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > xThrobber );
+ MigrationPage( svt::OWizardMachine* parent, const ResId& resid, Throbber& i_throbber );
virtual sal_Bool commitPage( svt::WizardTypes::CommitPageReason _eReason );
protected:
diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx
index 3e9836fa2e84..8bb9e82f3810 100644
--- a/desktop/source/migration/services/oo3extensionmigration.cxx
+++ b/desktop/source/migration/services/oo3extensionmigration.cxx
@@ -292,7 +292,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescript
utl::TextSearch ts(param, LANGUAGE_DONTKNOW);
xub_StrLen start = 0;
- xub_StrLen end = static_cast<USHORT>(aExtIdentifier.getLength());
+ xub_StrLen end = static_cast<sal_uInt16>(aExtIdentifier.getLength());
if (ts.SearchFrwrd(aExtIdentifier, &start, &end))
return false;
}
@@ -317,7 +317,7 @@ bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescript
utl::TextSearch ts(param, LANGUAGE_DONTKNOW);
xub_StrLen start = 0;
- xub_StrLen end = static_cast<USHORT>(sDescriptionXmlURL.getLength());
+ xub_StrLen end = static_cast<sal_uInt16>(sDescriptionXmlURL.getLength());
if (ts.SearchFrwrd(sDescriptionXmlURL, &start, &end))
return false;
}
diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx
index 1ac8f38dca56..fb73a905db6b 100755
--- a/desktop/source/migration/services/wordbookmigration.cxx
+++ b/desktop/source/migration/services/wordbookmigration.cxx
@@ -176,7 +176,7 @@ bool IsUserWordbook( const ::rtl::OUString& rFile )
bRet = true;
else
{
- USHORT nLen;
+ sal_uInt16 nLen;
pStream->Seek (nSniffPos);
*pStream >> nLen;
if ( nLen < MAX_HEADER_LENGTH )
diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx
index 5cc90577aaff..3489d7186b4f 100644
--- a/desktop/source/migration/wizard.cxx
+++ b/desktop/source/migration/wizard.cxx
@@ -87,16 +87,6 @@ const FirstStartWizard::WizardState FirstStartWizard::STATE_USER = 3;
const FirstStartWizard::WizardState FirstStartWizard::STATE_UPDATE_CHECK = 4;
const FirstStartWizard::WizardState FirstStartWizard::STATE_REGISTRATION = 5;
-static uno::Reference< uno::XComponentContext > getComponentContext( const uno::Reference< lang::XMultiServiceFactory >& rFactory )
-{
- uno::Reference< uno::XComponentContext > rContext;
- uno::Reference< beans::XPropertySet > rPropSet( rFactory, uno::UNO_QUERY );
- uno::Any a = rPropSet->getPropertyValue(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) );
- a >>= rContext;
- return rContext;
-}
-
static sal_Int32 getBuildId()
{
::rtl::OUString aDefault;
@@ -112,7 +102,7 @@ static sal_Int32 getBuildId()
return nBuildId;
}
-WizardResId::WizardResId( USHORT nId ) :
+WizardResId::WizardResId( sal_uInt16 nId ) :
ResId( nId, *FirstStartWizard::GetResManager() )
{
}
@@ -139,54 +129,14 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep
,m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance )
,m_bLicenseWasAccepted(sal_False)
,m_bAutomaticUpdChk(sal_True)
+ ,m_aThrobber(this, WizardResId(CTRL_THROBBER))
,m_aLicensePath( rLicensePath )
{
+ FreeResource();
// ---
- // FreeResource();
// enableState(STATE_USER, sal_False);
// enableState(STATE_REGISTRATION, sal_False);
- try
- {
- Point pos(5, 210 );
- Size size(11, 11 );
-
- pos = LogicToPixel( pos, MAP_APPFONT );
- size = LogicToPixel( size, MAP_APPFONT );
-
- uno::Reference< lang::XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
- uno::Reference< awt::XToolkit > xToolkit(
- uno::Reference< lang::XMultiComponentFactory >(
- xFactory, uno::UNO_QUERY_THROW)->
- createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")),
- getComponentContext(xFactory)),
- uno::UNO_QUERY_THROW);
-
- m_xThrobber = uno::Reference< awt::XThrobber >(
- xToolkit->createWindow(
- awt::WindowDescriptor(
- awt::WindowClass_SIMPLE,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Throbber")),
- GetComponentInterface(), 0,
- awt::Rectangle(
- pos.X(), pos.Y(), size.Width(), size.Height()),
- awt::WindowAttribute::SHOW)),
- uno::UNO_QUERY_THROW);
- }
- catch (uno::RuntimeException &)
- {
- throw;
- }
- catch (Exception& )
- {
- }
-
- uno::Reference< awt::XWindow > xThrobberWin( m_xThrobber, uno::UNO_QUERY );
- if ( xThrobberWin.is() )
- xThrobberWin->setVisible( false );
-
Size aTPSize(TP_WIDTH, TP_HEIGHT);
SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT));
@@ -280,7 +230,7 @@ long FirstStartWizard::PreNotify( NotifyEvent& rNEvt )
{
const KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
if( rKey.GetCode() == KEY_F1 && ! rKey.GetModifier() )
- return TRUE;
+ return sal_True;
}
return RoadmapWizard::PreNotify(rNEvt);
}
@@ -352,7 +302,7 @@ TabPage* FirstStartWizard::createPage(WizardState _nState)
pTabPage = new LicensePage(this, WizardResId(TP_LICENSE), m_aLicensePath);
break;
case STATE_MIGRATION:
- pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_xThrobber );
+ pTabPage = new MigrationPage(this, WizardResId(TP_MIGRATION), m_aThrobber);
break;
case STATE_USER:
pTabPage = new UserPage(this, WizardResId(TP_USER));
diff --git a/desktop/source/migration/wizard.hrc b/desktop/source/migration/wizard.hrc
index fdad97a8174b..8f35488c58b3 100644
--- a/desktop/source/migration/wizard.hrc
+++ b/desktop/source/migration/wizard.hrc
@@ -79,6 +79,7 @@
#define ED_USER_FATHER 18
#define ED_USER_INITIALS 19
#define TR_WAITING 20
+#define CTRL_THROBBER 21
// global strings
#define STR_STATE_WELCOME RID_FIRSTSTSTART_START+100
diff --git a/desktop/source/migration/wizard.hxx b/desktop/source/migration/wizard.hxx
index 3317880f8bd6..96bd74dcd859 100644
--- a/desktop/source/migration/wizard.hxx
+++ b/desktop/source/migration/wizard.hxx
@@ -30,9 +30,8 @@
#include <rtl/ustring.hxx>
#include <svtools/roadmapwizard.hxx>
-#include <vcl/window.hxx>
+#include <vcl/throbber.hxx>
#include <tools/resid.hxx>
-#include <com/sun/star/awt/XThrobber.hpp>
namespace desktop
{
@@ -40,7 +39,7 @@ namespace desktop
class WizardResId : public ResId
{
public:
- WizardResId( USHORT nId );
+ WizardResId( sal_uInt16 nId );
};
class FirstStartWizard : public svt::RoadmapWizard
@@ -76,7 +75,7 @@ private:
sal_Bool m_bLicenseWasAccepted;
sal_Bool m_bAutomaticUpdChk;
Link m_lnkCancel;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XThrobber > m_xThrobber;
+ Throbber m_aThrobber;
rtl::OUString m_aLicensePath;
diff --git a/desktop/source/migration/wizard.src b/desktop/source/migration/wizard.src
index e690e130c74f..78bd3a0e8197 100644
--- a/desktop/source/migration/wizard.src
+++ b/desktop/source/migration/wizard.src
@@ -42,6 +42,13 @@ ModalDialog DLG_FIRSTSTART_WIZARD
Closeable = TRUE ;
Hide = TRUE;
HelpID = HID_FIRSTSTART_DIALOG;
+
+ FixedImage CTRL_THROBBER
+ {
+ Pos = MAP_APPFONT( 5, 210 );
+ Size = MAP_APPFONT( 11, 11 );
+ Hide = TRUE;
+ };
};
String STR_STATE_WELCOME