summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/apphdl.cxx16
-rwxr-xr-x[-rw-r--r--]sw/source/ui/app/docsh.cxx78
-rw-r--r--sw/source/ui/app/swmodule.cxx1
-rw-r--r--sw/source/ui/cctrl/makefile.mk3
-rwxr-xr-x[-rw-r--r--]sw/source/ui/config/optpage.cxx22
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx6
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx7
-rw-r--r--sw/source/ui/dbui/mailmergewizard.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx4
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.hxx2
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx8
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.hxx2
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx2
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.hxx2
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx4
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.hxx2
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.cxx4
-rw-r--r--sw/source/ui/dbui/mmpreparemergepage.hxx2
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx146
-rw-r--r--sw/source/ui/dochdl/dochdl.src9
-rw-r--r--sw/source/ui/dochdl/gloshdl.cxx45
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx113
-rw-r--r--sw/source/ui/docvw/AnchorOverlayObject.cxx2
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx68
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx45
-rw-r--r--sw/source/ui/inc/SwSpellDialogChildWindow.hxx4
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx1
-rw-r--r--sw/source/ui/inc/view.hxx2
-rw-r--r--sw/source/ui/ribbar/makefile.mk5
-rw-r--r--sw/source/ui/shells/basesh.cxx5
-rw-r--r--sw/source/ui/shells/makefile.mk1
-rw-r--r--sw/source/ui/uiview/makefile.mk5
-rw-r--r--sw/source/ui/uiview/srcview.cxx14
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/view2.cxx11
-rw-r--r--sw/source/ui/uiview/viewdraw.cxx7
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/viewstat.cxx8
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx24
-rw-r--r--sw/source/ui/uno/makefile.mk3
-rw-r--r--sw/source/ui/uno/swdetect.cxx2
-rwxr-xr-xsw/source/ui/uno/unotxdoc.cxx15
-rw-r--r--sw/source/ui/uno/warnpassword.cxx86
-rw-r--r--sw/source/ui/utlui/makefile.mk4
42 files changed, 408 insertions, 384 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 93e88b3b74..f61b6434f1 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -765,24 +765,28 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
DELETEZ(pWebToolbarConfig) ;
DELETEZ(pAuthorNames) ;
DELETEZ(pDBConfig);
-
- if (pColorConfig != 0) {
+ if( pColorConfig )
+ {
pColorConfig->RemoveListener(this);
DELETEZ(pColorConfig);
}
- if (pAccessibilityOptions != 0) {
+ if( pAccessibilityOptions )
+ {
pAccessibilityOptions->RemoveListener(this);
DELETEZ(pAccessibilityOptions);
}
- if (pCTLOptions != 0) {
+ if( pCTLOptions )
+ {
pCTLOptions->RemoveListener(this);
DELETEZ(pCTLOptions);
}
- if (pUserOptions != 0) {
+ if( pUserOptions )
+ {
pUserOptions->RemoveListener(this);
DELETEZ(pUserOptions);
}
- if (pUndoOptions != 0) {
+ if( pUndoOptions )
+ {
pUndoOptions->RemoveListener(this);
DELETEZ(pUndoOptions);
}
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 66c6820148..5a1b8601f7 100644..100755
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -39,6 +39,7 @@
#include <svl/zforlist.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
+#include <svl/PasswordHelper.hxx>
#include <editeng/adjitem.hxx>
#include <basic/sbx.hxx>
#include <unotools/moduleoptions.hxx>
@@ -101,7 +102,6 @@
#include <cmdid.h>
#include <globals.hrc>
#include <app.hrc>
-#include "warnpassword.hxx"
#include <cfgid.h>
#include <unotools/moduleoptions.hxx>
@@ -1368,3 +1368,79 @@ const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
{
return pDoc ? &pDoc->GetXmlIdRegistry() : 0;
}
+
+
+bool SwDocShell::IsChangeRecording() const
+{
+ return (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0;
+}
+
+
+bool SwDocShell::HasChangeRecordProtection() const
+{
+ return pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0;
+}
+
+
+void SwDocShell::SetChangeRecording( bool bActivate )
+{
+ USHORT nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0;
+ USHORT nMode = pWrtShell->GetRedlineMode();
+ pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn);
+}
+
+
+bool SwDocShell::SetProtectionPassword( const String &rNewPassword )
+{
+ const SfxAllItemSet aSet( GetPool() );
+ const SfxItemSet* pArgs = &aSet;
+ const SfxPoolItem* pItem = NULL;
+
+ IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess();
+ Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword();
+ if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem )
+ && ((SfxBoolItem*)pItem)->GetValue() == aPasswd.getLength() > 0)
+ return false;
+
+ bool bRes = false;
+
+ if (rNewPassword.Len())
+ {
+ // when password protection is applied change tracking must always be active
+ SetChangeRecording( true );
+
+ Sequence< sal_Int8 > aNewPasswd;
+ SvPasswordHelper::GetHashPassword( aNewPasswd, rNewPassword );
+ pIDRA->SetRedlinePassword( aNewPasswd );
+ bRes = true;
+ }
+ else
+ {
+ pIDRA->SetRedlinePassword( Sequence< sal_Int8 >() );
+ bRes = true;
+ }
+
+ return bRes;
+}
+
+
+bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash )
+{
+ bool bRes = false;
+
+ const SfxAllItemSet aSet( GetPool() );
+ const SfxItemSet* pArgs = &aSet;
+ const SfxPoolItem* pItem = NULL;
+
+ IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess();
+ Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() );
+ if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, FALSE, &pItem )
+ && ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0))
+ return false;
+ rPasswordHash = aPasswdHash;
+ bRes = true;
+
+ return bRes;
+}
+
+
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 56252239f4..b918edc3af 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -207,7 +207,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
pView(0),
bAuthorInitialised(sal_False),
bEmbeddedLoadSave( sal_False ),
- pClipboard( 0 ),
pDragDrop( 0 ),
pXSelection( 0 )
{
diff --git a/sw/source/ui/cctrl/makefile.mk b/sw/source/ui/cctrl/makefile.mk
index c724f287fc..33ba83f34d 100644
--- a/sw/source/ui/cctrl/makefile.mk
+++ b/sw/source/ui/cctrl/makefile.mk
@@ -50,6 +50,9 @@ SLOFILES = \
$(SLO)$/popbox.obj \
$(SLO)$/swlbox.obj
+EXCEPTIONSFILES = \
+ $(SLO)$/popbox.obj
+
# --- Tagets -------------------------------------------------------
.INCLUDE : target.mk
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 40c17f9866..8d3943834c 100644..100755
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -542,10 +542,15 @@ void SwAddPrinterTabPage::Reset( const SfxItemSet& )
aFaxLB.SelectEntry( pAddPrinterAttr->sFaxName );
}
if (aProspectCB.IsChecked())
+ {
aProspectCB_RTL.Enable(TRUE);
+ aNoRB.Enable( FALSE );
+ aOnlyRB.Enable( FALSE );
+ aEndRB.Enable( FALSE );
+ aEndPageRB.Enable( FALSE );
+ }
else
- aProspectCB_RTL.Disable();
-
+ aProspectCB_RTL.Enable( FALSE );
}
//-----------------------------------------------------------------------
@@ -560,13 +565,14 @@ void SwAddPrinterTabPage::Init()
IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
{
bAttrModified = TRUE;
- if (aProspectCB.IsChecked())
- aProspectCB_RTL.Enable(TRUE);
- else
- {
+ bool bIsProspect = aProspectCB.IsChecked();
+ if (!bIsProspect)
aProspectCB_RTL.Check( FALSE );
- aProspectCB_RTL.Disable();
- }
+ aProspectCB_RTL.Enable( bIsProspect );
+ aNoRB.Enable( !bIsProspect );
+ aOnlyRB.Enable( !bIsProspect );
+ aEndRB.Enable( !bIsProspect );
+ aEndPageRB.Enable( !bIsProspect );
return 0;
}
IMPL_LINK_INLINE_END( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index ee129df190..42d4db33f0 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1911,7 +1911,7 @@ void SwInsertDBColAutoPilot::Load()
SwInsDBColumn& rSet = *aDBColumns[ n ];
for( USHORT m = 0; m < pNewData->aDBColumns.Count() ; ++m )
{
- const SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ];
+ SwInsDBColumn& rGet = *pNewData->aDBColumns[ m ];
if(rGet.sColumn == rSet.sColumn)
{
if( rGet.bHasFmt && !rGet.bIsDBFmt )
@@ -1923,8 +1923,10 @@ void SwInsertDBColAutoPilot::Load()
{
xub_StrLen nCheckPos;
short nType;
- rNFmtr.PutEntry( (String&)rGet.sUsrNumFmt, nCheckPos, nType,
+ String sTmpFmt = rGet.sUsrNumFmt;
+ rNFmtr.PutEntry( sTmpFmt, nCheckPos, nType,
rSet.nUsrNumFmt, rGet.eUsrNumFmtLng );
+ rGet.sUsrNumFmt = sTmpFmt;
}
}
break;
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 3cdba36e57..d550c3b3af 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -2907,9 +2907,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
}
else
{
- SwDoc* pNewDoc = rSourceView.GetDocShell()->GetDoc()->CreateCopy();
- xWorkDocSh = new SwDocShell( pNewDoc, SFX_CREATE_MODE_STANDARD );
- xWorkDocSh->DoInitNew();
+ xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true);
}
//create a ViewFrame
SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::LoadHiddenDocument( *xWorkDocSh, 0 )->GetViewShell() );
@@ -3032,8 +3030,9 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pTargetShell->SttDoc();
//
}
- catch( Exception& )
+ catch( Exception& rEx)
{
+ (void)rEx;
DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments");
}
DELETEZ(pImpl->pMergeData);
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index fd601bdfb1..4a412991e0 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -260,7 +260,7 @@ void SwMailMergeWizard::UpdateRoadmap()
//#i97436# if a document has to be loaded then enable output type page only
m_bDocumentLoad = false;
bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) ||
- static_cast<svt::OWizardPage*>(pCurPage)->commitPage( eValidate );
+ static_cast<svt::OWizardPage*>(pCurPage)->commitPage( ::svt::WizardTypes::eValidate );
for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_OUTPUTPAGE; ++nPage)
{
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index d179e02e51..ae6b6b0cb0 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -175,9 +175,9 @@ void SwMailMergeAddressBlockPage::ActivatePage()
/*-- 27.05.2004 13:59:15---------------------------------------------------
-----------------------------------------------------------------------*/
-sal_Bool SwMailMergeAddressBlockPage::commitPage( CommitPageReason _eReason )
+sal_Bool SwMailMergeAddressBlockPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
- if ( eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() )
+ if ( ::svt::WizardTypes::eTravelForward == _eReason && !m_pWizard->GetConfigItem().GetResultSet().is() )
return sal_False;
return sal_True;
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 8bbd2fdc8d..2436a170d4 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -98,7 +98,7 @@ class SwMailMergeAddressBlockPage : public svt::OWizardPage
void EnableAddressBlock(sal_Bool bAll, sal_Bool bSelective);
virtual void ActivatePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
virtual bool canAdvance() const;
public:
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 57b3b15cfc..7427bfc687 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -197,11 +197,11 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
/*-- 06.04.2004 12:52:24---------------------------------------------------
-----------------------------------------------------------------------*/
-sal_Bool SwMailMergeDocSelectPage::commitPage( CommitPageReason _eReason )
+sal_Bool SwMailMergeDocSelectPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
sal_Bool bReturn = sal_False;
- bool bNext = _eReason == eTravelForward;
- if(bNext || _eReason == eValidate )
+ bool bNext = _eReason == ::svt::WizardTypes::eTravelForward;
+ if(bNext || _eReason == ::svt::WizardTypes::eValidate )
{
::rtl::OUString sReloadDocument;
bReturn = m_aCurrentDocRB.IsChecked() ||
@@ -209,7 +209,7 @@ sal_Bool SwMailMergeDocSelectPage::commitPage( CommitPageReason _eReason )
((sReloadDocument = m_sLoadFileName).getLength() && m_aLoadDocRB.IsChecked() )||
((sReloadDocument = m_sLoadTemplateName).getLength() && m_aLoadTemplateRB.IsChecked())||
(m_aRecentDocRB.IsChecked() && (sReloadDocument = m_aRecentDocLB.GetSelectEntry()).getLength());
- if( _eReason == eValidate )
+ if( _eReason == ::svt::WizardTypes::eValidate )
m_pWizard->SetDocumentLoad(!m_aCurrentDocRB.IsChecked());
if(bNext && !m_aCurrentDocRB.IsChecked())
diff --git a/sw/source/ui/dbui/mmdocselectpage.hxx b/sw/source/ui/dbui/mmdocselectpage.hxx
index f9f4cc897c..363aecdddc 100644
--- a/sw/source/ui/dbui/mmdocselectpage.hxx
+++ b/sw/source/ui/dbui/mmdocselectpage.hxx
@@ -61,7 +61,7 @@ class SwMailMergeDocSelectPage : public svt::OWizardPage
DECL_LINK(DocSelectHdl, RadioButton*);
DECL_LINK(FileSelectHdl, PushButton*);
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
public:
SwMailMergeDocSelectPage( SwMailMergeWizard* _pParent);
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 4e287a5a28..db0038274a 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -390,7 +390,7 @@ void SwMailMergeGreetingsPage::ActivatePage()
/*-- 11.05.2004 14:47:10---------------------------------------------------
-----------------------------------------------------------------------*/
-sal_Bool SwMailMergeGreetingsPage::commitPage( CommitPageReason )
+sal_Bool SwMailMergeGreetingsPage::commitPage( ::svt::WizardTypes::CommitPageReason )
{
SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem();
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx
index c41e804da8..230beab4c3 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -122,7 +122,7 @@ class SwMailMergeGreetingsPage : public svt::OWizardPage,
virtual void UpdatePreview();
virtual void ActivatePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
public:
SwMailMergeGreetingsPage( SwMailMergeWizard* _pParent);
~SwMailMergeGreetingsPage();
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 8efda3455a..91312c9914 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -254,11 +254,11 @@ void SwMailMergeLayoutPage::ActivatePage()
/*-- 11.05.2004 10:41:26---------------------------------------------------
-----------------------------------------------------------------------*/
-sal_Bool SwMailMergeLayoutPage::commitPage( CommitPageReason _eReason )
+sal_Bool SwMailMergeLayoutPage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
//now insert the frame and the greeting
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
- if(eTravelForward == _eReason)
+ if(::svt::WizardTypes::eTravelForward == _eReason)
{
long nLeft = static_cast< long >(m_aLeftMF.Denormalize(m_aLeftMF.GetValue(FUNIT_TWIP)));
long nTop = static_cast< long >(m_aTopMF.Denormalize(m_aTopMF.GetValue(FUNIT_TWIP)));
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index 79bc1e1d15..137eb7bf04 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -98,7 +98,7 @@ class SwMailMergeLayoutPage : public svt::OWizardPage
static void InsertGreeting(SwWrtShell& rShell, SwMailMergeConfigItem& rConfigItem, bool bExample);
virtual void ActivatePage();
- virtual sal_Bool commitPage(CommitPageReason _eReason);
+ virtual sal_Bool commitPage(::svt::WizardTypes::CommitPageReason _eReason);
public:
SwMailMergeLayoutPage( SwMailMergeWizard* _pParent);
~SwMailMergeLayoutPage();
diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx
index a6dc5d09c1..5fe51c094e 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.cxx
+++ b/sw/source/ui/dbui/mmpreparemergepage.cxx
@@ -191,10 +191,10 @@ void SwMailMergePrepareMergePage::ActivatePage()
/*-- 13.05.2004 15:38:32---------------------------------------------------
merge the data into a new file
-----------------------------------------------------------------------*/
-sal_Bool SwMailMergePrepareMergePage::commitPage( CommitPageReason _eReason )
+sal_Bool SwMailMergePrepareMergePage::commitPage( ::svt::WizardTypes::CommitPageReason _eReason )
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
- if(eTravelForward == _eReason && !rConfigItem.IsMergeDone())
+ if(::svt::WizardTypes::eTravelForward == _eReason && !rConfigItem.IsMergeDone())
{
m_pWizard->CreateTargetDocument();
m_pWizard->SetRestartPage(MM_MERGEPAGE);
diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx
index 25aded367e..53494b36d5 100644
--- a/sw/source/ui/dbui/mmpreparemergepage.hxx
+++ b/sw/source/ui/dbui/mmpreparemergepage.hxx
@@ -64,7 +64,7 @@ class SwMailMergePrepareMergePage : public svt::OWizardPage
DECL_LINK(MoveHdl_Impl, void*);
virtual void ActivatePage();
- virtual sal_Bool commitPage( CommitPageReason _eReason );
+ virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
public:
SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent);
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index 4ae70d26db..b7fd189741 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -32,13 +32,13 @@
#include <vcl/msgbox.hxx>
#include <editeng/svxacorr.hxx>
#include <editeng/acorrcfg.hxx>
-#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
-#endif
#include <sfx2/app.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <editeng/unolingu.hxx>
+#include <editeng/editeng.hxx>
+#include <editeng/editview.hxx>
#include <wrtsh.hxx>
#include <sfx2/printer.hxx>
#include <svx/svdoutl.hxx>
@@ -56,9 +56,7 @@
#include <pam.hxx>
#include <drawbase.hxx>
#include <unotextrange.hxx>
-#ifndef _DIALOG_HXX
#include <dialog.hrc>
-#endif
#include <cmdid.h>
@@ -202,12 +200,19 @@ SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const
-----------------------------------------------------------------------*/
-svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
+svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
{
svx::SpellPortions aRet;
SwWrtShell* pWrtShell = GetWrtShell_Impl();
if(pWrtShell)
{
+ if (!bRecheck)
+ {
+ // first set continuation point for spell/grammar check to the
+ // end of the current sentence
+ pWrtShell->MoveContinuationPosToEndOfCheckedSentence();
+ }
+
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode;
bool bNormalText =
@@ -239,7 +244,10 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
if(!pWrtShell->HasSelection())
pWrtShell->GoStartSentence();
else
+ {
+ pWrtShell->ExpandToSentenceBorders();
m_pSpellState->m_bStartedInSelection = true;
+ }
//determine if the selection is outside of the body text
bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
m_pSpellState->m_SpellStartPosition = bOtherText ? SPELL_START_OTHER : SPELL_START_BODY;
@@ -269,7 +277,24 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
m_pSpellState->m_SpellStartPosition = SPELL_START_DRAWTEXT;
m_pSpellState->m_pStartDrawing = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj();
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- m_pSpellState->m_aStartDrawingSelection = pOLV->GetSelection();
+ // start checking at the top of the drawing object
+ pOLV->SetSelection( ESelection() );
+ m_pSpellState->m_aStartDrawingSelection = ESelection();
+/*
+Note: spelling in a selection only, or starting in a mid of a drawing object requires
+further changes elsewhere. (Especially if it should work in sc and sd as well.)
+The code below would only be part of the solution.
+(Keeping it a as a comment for the time being)
+ ESelection aCurSel( pOLV->GetSelection() );
+ ESelection aSentenceSel( pOLV->GetEditView().GetEditEngine()->SelectSentence( aCurSel ) );
+ if (!aCurSel.HasRange())
+ {
+ aSentenceSel.nEndPara = aSentenceSel.nStartPara;
+ aSentenceSel.nEndPos = aSentenceSel.nStartPos;
+ }
+ pOLV->SetSelection( aSentenceSel );
+ m_pSpellState->m_aStartDrawingSelection = aSentenceSel;
+*/
}
m_pSpellState->m_bInitialCall = false;
@@ -316,61 +341,66 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
//spell inside of the Writer text
if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
{
- //find out which text has been spelled body or other
- bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
- if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor)
+ // if there is a selection (within body or header/footer text)
+ // then spell/grammar checking should not move outside of it.
+ if (!m_pSpellState->m_bStartedInSelection)
{
- m_pSpellState->m_bStartedInOther = false;
- pWrtShell->SetSelection(*m_pSpellState->pOtherCursor);
- pWrtShell->SpellEnd();
- delete m_pSpellState->pOtherCursor;
- m_pSpellState->pOtherCursor = 0;
- pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, FALSE );
- pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn);
- }
- if(!aRet.size())
- {
- //end spelling
- pWrtShell->SpellEnd();
- if(bOtherText)
+ //find out which text has been spelled body or other
+ bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY);
+ if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor)
{
- m_pSpellState->m_bOtherSpelled = true;
- //has the body been spelled?
- if(!m_pSpellState->m_bBodySpelled)
+ m_pSpellState->m_bStartedInOther = false;
+ pWrtShell->SetSelection(*m_pSpellState->pOtherCursor);
+ pWrtShell->SpellEnd();
+ delete m_pSpellState->pOtherCursor;
+ m_pSpellState->pOtherCursor = 0;
+ pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, FALSE );
+ pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn);
+ }
+ if(!aRet.size())
+ {
+ //end spelling
+ pWrtShell->SpellEnd();
+ if(bOtherText)
{
- pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, FALSE );
- if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
+ m_pSpellState->m_bOtherSpelled = true;
+ //has the body been spelled?
+ if(!m_pSpellState->m_bBodySpelled)
{
- m_pSpellState->m_bBodySpelled = true;
- pWrtShell->SpellEnd();
+ pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, FALSE );
+ if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
+ {
+ m_pSpellState->m_bBodySpelled = true;
+ pWrtShell->SpellEnd();
+ }
}
}
+ else
+ {
+ m_pSpellState->m_bBodySpelled = true;
+ if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt())
+ {
+ pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, FALSE );
+ if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
+ {
+ pWrtShell->SpellEnd();
+ m_pSpellState->m_bOtherSpelled = true;
+ }
+ }
+ else
+ m_pSpellState->m_bOtherSpelled = true;
+ }
}
- else
+
+ //search for a draw text object that contains error and spell it
+ if(!aRet.size() &&
+ (m_pSpellState->m_bDrawingsSpelled ||
+ !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet)))
{
- m_pSpellState->m_bBodySpelled = true;
- if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt())
- {
- pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, FALSE );
- if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn))
- {
- pWrtShell->SpellEnd();
- m_pSpellState->m_bOtherSpelled = true;
- }
- }
- else
- m_pSpellState->m_bOtherSpelled = true;
+ lcl_LeaveDrawText(*pWrtShell);
+ m_pSpellState->m_bDrawingsSpelled = true;
}
}
-
- //search for a draw text object that contains error and spell it
- if(!aRet.size() &&
- (m_pSpellState->m_bDrawingsSpelled ||
- !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet)))
- {
- lcl_LeaveDrawText(*pWrtShell);
- m_pSpellState->m_bDrawingsSpelled = true;
- }
}
}
// now only the rest of the body text can be spelled -
@@ -430,7 +460,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void)
/*-- 09.09.2003 10:39:40---------------------------------------------------
-----------------------------------------------------------------------*/
-void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged)
+void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck)
{
SwWrtShell* pWrtShell = GetWrtShell_Impl();
DBG_ASSERT(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume");
@@ -443,13 +473,19 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC
SHELL_MODE_LIST_TEXT == eSelMode ||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode ||
SHELL_MODE_TEXT == eSelMode;
+
+ // evaluate if the same sentence should be rechecked or not.
+ // Sentences that got grammar checked should always be rechecked in order
+ // to detect possible errors that get introduced with the changes
+ bRecheck |= pWrtShell->HasLastSentenceGotGrammarChecked();
+
if(bNormalText)
- pWrtShell->ApplyChangedSentence(rChanged, m_bIsGrammarCheckingOn);
+ pWrtShell->ApplyChangedSentence(rChanged, bRecheck);
else if(bDrawText )
{
SdrView* pDrView = pWrtShell->GetDrawView();
SdrOutliner *pOutliner = pDrView->GetTextEditOutliner();
- pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, m_bIsGrammarCheckingOn);
+ pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, bRecheck);
}
}
}
@@ -847,7 +883,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
Point aTmp( 0,0 );
rSh.SelectObj( aTmp, 0, pTextObj );
SdrPageView* pPV = pDrView->GetSdrPageView();
- rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), FALSE );
+ rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), FALSE, TRUE );
rView.AttrChangedNotify(&rSh);
bNextDoc = true;
}
diff --git a/sw/source/ui/dochdl/dochdl.src b/sw/source/ui/dochdl/dochdl.src
index fb4db99410..2afd19c92b 100644
--- a/sw/source/ui/dochdl/dochdl.src
+++ b/sw/source/ui/dochdl/dochdl.src
@@ -73,13 +73,4 @@ String STR_DDEFORMAT
{
Text [ en-US ] = "DDE link" ;
};
-Bitmap BMP_SW_TEAM_MUGSHOT
-{
- File ="writerteam.bmp";
-};
-
-String STR_SW_TEAM_NAMES
-{
- Text = "Back row: Aidan Butler, Hans-Peter Burow, Caolan McNamara, Michael Brauer, Martin Maher, Gunnar Timm\nFront row: Thomas Lange, Oliver-Rainer Duesterhoeft, Henning Brinkmann, Andreas Martens, Oliver Specht, Frank Meies, Daniel Vogelheim";
-};
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index f51cfde701..c19fb0bd9d 100644
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -607,48 +607,9 @@ BOOL SwGlossaryHdl::Expand( const String& rShortName,
aShortName.Erase(nMaxLen);
aShortName.AppendAscii(" ...");
}
- if ( aShortName.EqualsAscii ( "StarWriterTeam", 0, 14 ) )
- {
- String sGraphicName ( RTL_CONSTASCII_USTRINGPARAM ( "StarWriter team photo" ) );
- String sTeamCredits ( RTL_CONSTASCII_USTRINGPARAM ( "StarWriter team credits" ) );
- pWrtShell->StartUndo ( UNDO_INSGLOSSARY );
- pWrtShell->StartAllAction();
- if(pWrtShell->HasSelection())
- pWrtShell->DelLeft();
- Bitmap aBitmap ( SW_RES ( BMP_SW_TEAM_MUGSHOT ) );
- pWrtShell->Insert ( aEmptyStr, aEmptyStr, aBitmap);
- pWrtShell->SetFlyName ( sGraphicName );
- SwTxtFmtColl* pColl = pWrtShell->GetTxtCollFromPool ( RES_POOLCOLL_LABEL_ABB );
- const IDocumentFieldsAccess* pIDFA = pWrtShell->getIDocumentFieldsAccess();
- SwFieldType* pType = pIDFA->GetFldType( RES_SETEXPFLD, pColl->GetName(), false );
- sal_uInt16 nId = pIDFA->GetFldTypes()->GetPos( pType );
- pWrtShell->InsertLabel( LTYPE_OBJECT, aEmptyStr, aEmptyStr, aEmptyStr, FALSE, nId, aEmptyStr );
- pWrtShell->SwFEShell::SetFlyName( sTeamCredits );
- pWrtShell->SwFEShell::SelectObj ( Point ( ULONG_MAX, ULONG_MAX ) );
- pWrtShell->EnterStdMode();
- pWrtShell->EndPara ( TRUE );
- String aTmp ( SW_RES ( STR_SW_TEAM_NAMES ) );
- pWrtShell->Insert ( aTmp );
- SvxAdjustItem aAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST );
- pWrtShell->SetAttr( aAdjustItem );
- pWrtShell->SttPara ();
- pWrtShell->SplitNode();
- pWrtShell->Left(CRSR_SKIP_CHARS, FALSE, 1, FALSE );
- SvxWeightItem aWeightItem ( WEIGHT_BOLD, RES_CHRATR_WEIGHT );
- pWrtShell->Insert ( String ( RTL_CONSTASCII_USTRINGPARAM ( "The StarWriter team!" ) ) );
- pWrtShell->SttPara ( TRUE );
- pWrtShell->SetAttr( aWeightItem);
- pWrtShell->GotoFly ( sTeamCredits);
- pWrtShell->EndAllAction();
- pWrtShell->EndUndo( UNDO_INSGLOSSARY );
- }
- else
- {
- String aTmp( SW_RES(STR_NOGLOS));
- aTmp.SearchAndReplaceAscii("%1", aShortName);
- InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute();
-
- }
+ String aTmp( SW_RES(STR_NOGLOS));
+ aTmp.SearchAndReplaceAscii("%1", aShortName);
+ InfoBox( pWrtShell->GetView().GetWindow(), aTmp ).Execute();
}
return FALSE;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index c19189a563..211e5d0f73 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -300,9 +300,7 @@ SwTransferable::~SwTransferable()
SwModule* pMod = SW_MOD();
if(pMod)
{
- if ( pMod->pClipboard == this )
- pMod->pClipboard = 0;
- else if ( pMod->pDragDrop == this )
+ if ( pMod->pDragDrop == this )
pMod->pDragDrop = 0;
else if ( pMod->pXSelection == this )
pMod->pXSelection = 0;
@@ -338,9 +336,7 @@ static SwDoc * lcl_GetDoc(SwDocFac & rDocFac)
void SwTransferable::ObjectReleased()
{
SwModule *pMod = SW_MOD();
- if( this == pMod->pClipboard )
- pMod->pClipboard = 0;
- else if( this == pMod->pDragDrop )
+ if( this == pMod->pDragDrop )
pMod->pDragDrop = 0;
else if( this == pMod->pXSelection )
pMod->pXSelection = 0;
@@ -1013,7 +1009,6 @@ int SwTransferable::Copy( BOOL bIsCut )
int nRet = PrepareForCopy( bIsCut );
if ( nRet )
{
- SW_MOD()->pClipboard = this;
CopyToClipboard( &pWrtShell->GetView().GetEditWin() );
}
return nRet;
@@ -1035,7 +1030,6 @@ int SwTransferable::CalculateAndCopy()
eBufferType = TRNSFR_DOCUMENT;
AddFormat( FORMAT_STRING );
- SW_MOD()->pClipboard = this;
CopyToClipboard( &pWrtShell->GetView().GetEditWin() );
return 1;
@@ -1086,7 +1080,6 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary,
PrepareOLE( aObjDesc );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
- SW_MOD()->pClipboard = this;
CopyToClipboard( &pWrtShell->GetView().GetEditWin() );
return 1;
@@ -1104,20 +1097,14 @@ BOOL SwTransferable::IsPaste( const SwWrtShell& rSh,
// Check the common case first: We can always paste our own data!
// #106503#: If _only_ the internal format can be pasted, this check will
// yield 'true', while the one below would give a (wrong) result 'false'.
- bool bIsPaste = ( SW_MOD()->pClipboard != NULL );
+
+ bool bIsPaste = ( GetSwTransferable( rData ) != NULL );
// if it's not our own data, we need to have a closer look:
- if( ! bIsPaste )
+ if( ! bIsPaste )
{
// determine the proper paste action, and return true if we find one
uno::Reference<XTransferable> xTransferable( rData.GetXTransferable() );
- uno::Reference<XUnoTunnel> xTunnel( xTransferable, UNO_QUERY );
- if ( xTunnel.is() )
- {
- sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
- if ( nHandle )
- return TRUE;
- }
USHORT nDestination = SwTransferable::GetSotDestination( rSh );
USHORT nSourceOptions =
@@ -1153,36 +1140,27 @@ int SwTransferable::Paste( SwWrtShell& rSh, TransferableDataHelper& rData )
nDestination = SwTransferable::GetSotDestination( rSh );
ULONG nFormat = 0;
- if( SW_MOD()->pClipboard )
+ if( GetSwTransferable( rData ) )
+ {
nAction = EXCHG_OUT_ACTION_INSERT_PRIVATE;
+ }
else
{
- uno::Reference<XUnoTunnel> xTunnel( rData.GetTransferable(), UNO_QUERY );
- if ( xTunnel.is() )
- {
- sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
- if ( nHandle )
- nAction = EXCHG_OUT_ACTION_INSERT_PRIVATE;
- }
-
- if ( !nAction )
- {
- USHORT nSourceOptions =
- (( EXCHG_DEST_DOC_TEXTFRAME == nDestination ||
- EXCHG_DEST_SWDOC_FREE_AREA == nDestination ||
- EXCHG_DEST_DOC_TEXTFRAME_WEB == nDestination ||
- EXCHG_DEST_SWDOC_FREE_AREA_WEB == nDestination )
- ? EXCHG_IN_ACTION_COPY
- : EXCHG_IN_ACTION_MOVE);
- uno::Reference<XTransferable> xTransferable( rData.GetXTransferable() );
- nAction = SotExchange::GetExchangeAction(
- rData.GetDataFlavorExVector(),
- nDestination,
- nSourceOptions, /* ?? */
- EXCHG_IN_ACTION_DEFAULT, /* ?? */
- nFormat, nEventAction, 0,
- lcl_getTransferPointer ( xTransferable ) );
- }
+ USHORT nSourceOptions =
+ (( EXCHG_DEST_DOC_TEXTFRAME == nDestination ||
+ EXCHG_DEST_SWDOC_FREE_AREA == nDestination ||
+ EXCHG_DEST_DOC_TEXTFRAME_WEB == nDestination ||
+ EXCHG_DEST_SWDOC_FREE_AREA_WEB == nDestination )
+ ? EXCHG_IN_ACTION_COPY
+ : EXCHG_IN_ACTION_MOVE);
+ uno::Reference<XTransferable> xTransferable( rData.GetXTransferable() );
+ nAction = SotExchange::GetExchangeAction(
+ rData.GetDataFlavorExVector(),
+ nDestination,
+ nSourceOptions, /* ?? */
+ EXCHG_IN_ACTION_DEFAULT, /* ?? */
+ nFormat, nEventAction, 0,
+ lcl_getTransferPointer ( xTransferable ) );
}
// special case for tables from draw application
@@ -1216,7 +1194,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
int nRet = 0;
bool bCallAutoCaption = false;
-
+
if( pPt )
{
// external Drop
@@ -1245,7 +1223,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
}
}
}
- else if( ( !pMod->pClipboard || bIsPasteFmt ) &&
+ else if( ( !GetSwTransferable( rData ) || bIsPasteFmt ) &&
!rSh.IsTableMode() && rSh.HasSelection() )
{
// dann die Selektionen loeschen
@@ -1273,14 +1251,14 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
// <--
}
- SwTransferable *pTrans=0, *pTunneledTrans=0;
- uno::Reference<XUnoTunnel> xTunnel( rData.GetTransferable(), UNO_QUERY );
- if ( xTunnel.is() )
- {
- sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
- if ( nHandle )
- pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle;
- }
+ SwTransferable *pTrans=0, *pTunneledTrans=GetSwTransferable( rData );
+// uno::Reference<XUnoTunnel> xTunnel( rData.GetTransferable(), UNO_QUERY );
+// if ( xTunnel.is() )
+// {
+// sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
+// if ( nHandle )
+// pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle;
+// }
if( pPt && ( bPasteSelection ? 0 != ( pTrans = pMod->pXSelection )
: 0 != ( pTrans = pMod->pDragDrop) ))
@@ -1289,7 +1267,7 @@ int SwTransferable::PasteData( TransferableDataHelper& rData,
nRet = pTrans->PrivateDrop( rSh, *pPt, DND_ACTION_MOVE == nDropAction,
bPasteSelection );
}
- else if( !pPt && ( pTunneledTrans || 0 != ( pTunneledTrans = pMod->pClipboard ) ) &&
+ else if( !pPt && pTunneledTrans &&
EXCHG_OUT_ACTION_INSERT_PRIVATE == nAction )
{
// then internal paste
@@ -2816,7 +2794,7 @@ int SwTransferable::PasteFormat( SwWrtShell& rSh,
int nRet = 0;
ULONG nPrivateFmt = FORMAT_PRIVATE;
- SwTransferable *pClipboard = SW_MOD()->pClipboard;
+ SwTransferable *pClipboard = GetSwTransferable( rData );
if( pClipboard &&
((TRNSFR_DOCUMENT|TRNSFR_GRAPHIC|TRNSFR_OLE) & pClipboard->eBufferType ))
nPrivateFmt = SOT_FORMATSTR_ID_EMBED_SOURCE;
@@ -2912,7 +2890,7 @@ int SwTransferable::PasteSpecial( SwWrtShell& rSh, TransferableDataHelper& rData
USHORT nDest = SwTransferable::GetSotDestination( rSh );
- SwTransferable *pClipboard = SW_MOD()->pClipboard;
+ SwTransferable *pClipboard = GetSwTransferable( rData );
if( pClipboard )
{
aDesc = pClipboard->aObjDesc;
@@ -2978,7 +2956,8 @@ void SwTransferable::FillClipFmtItem( const SwWrtShell& rSh,
SvxClipboardFmtItem & rToFill )
{
USHORT nDest = SwTransferable::GetSotDestination( rSh );
- SwTransferable *pClipboard = SW_MOD()->pClipboard;
+
+ SwTransferable *pClipboard = GetSwTransferable( rData );
if( pClipboard )
{
USHORT nResId;
@@ -3634,6 +3613,22 @@ sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) throw(
return nRet;
}
+SwTransferable* SwTransferable::GetSwTransferable( const TransferableDataHelper& rData )
+{
+ SwTransferable* pSwTransferable = NULL;
+
+ uno::Reference<XUnoTunnel> xTunnel( rData.GetTransferable(), UNO_QUERY );
+ if ( xTunnel.is() )
+ {
+ sal_Int64 nHandle = xTunnel->getSomething( getUnoTunnelId() );
+ if ( nHandle )
+ pSwTransferable = (SwTransferable*) (sal_IntPtr) nHandle;
+ }
+
+ return pSwTransferable;
+
+}
+
/* */
// -----------------------------------------------------------------------
diff --git a/sw/source/ui/docvw/AnchorOverlayObject.cxx b/sw/source/ui/docvw/AnchorOverlayObject.cxx
index 53afaf6257..5ed5b076a9 100644
--- a/sw/source/ui/docvw/AnchorOverlayObject.cxx
+++ b/sw/source/ui/docvw/AnchorOverlayObject.cxx
@@ -95,7 +95,7 @@ public:
const basegfx::B2DPolygon& getTriangle() const { return maTriangle; }
const basegfx::B2DPolygon& getLine() const { return maLine; }
const basegfx::B2DPolygon& getLineTop() const { return maLineTop; }
- const AnchorState getAnchorState() const { return maAnchorState; }
+ AnchorState getAnchorState() const { return maAnchorState; }
const basegfx::BColor& getColor() const { return maColor; }
double getLogicLineWidth() const { return mfLogicLineWidth; }
bool getShadow() const { return mbShadow; }
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index e8de9b4be8..35067b2947 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1304,7 +1304,7 @@ void SwPostItMgr::Delete()
CalcRects();
LayoutPostIts();
}
-
+#if 0
void SwPostItMgr::Hide(SwPostItField* pPostItField )
{
for(std::list<SwSidebarItem*>::iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
@@ -1323,7 +1323,7 @@ void SwPostItMgr::Hide(SwPostItField* pPostItField )
LayoutPostIts();
}
-
+#endif
void SwPostItMgr::Hide( const String& rAuthor )
{
for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++)
@@ -1398,30 +1398,6 @@ sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItFie
return NULL;
}
-bool SwPostItMgr::ShowPreview(const SwField* pFld, SwFmtFld*& pFmtFld) const
-{
- for (unsigned long n=0;n<mPages.size();n++)
- {
- if (mPages[n]->mList->size()>0)
- {
- for(const_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
- {
- if ( (*i)->GetFmtFld() && ((*i)->GetFmtFld()->GetFld()==pFld) )
- {
- pFmtFld = (*i)->GetFmtFld();
- const long aSidebarheight = mPages[n]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0;
- bool bTopPage = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y())).Y() >= (mPages[n]->mPageRect.Top()+aSidebarheight);
- bool bBottomPage = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y()+(*i)->pPostIt->GetSizePixel().Height())).Y() <= (mPages[n]->mPageRect.Bottom()-aSidebarheight);
- const bool bTopVis = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y())).Y() > mpView->GetVisArea().Top();
- const bool bBottomVis = mpEditWin->PixelToLogic(Point(0,(*i)->pPostIt->GetPosPixel().Y()/*+(*i)->pPostIt->GetSizePixel().Height()*/)).Y() <= mpView->GetVisArea().Bottom();
- return !(bBottomPage && bTopPage && bBottomVis && bTopVis);
- }
- }
- }
- }
- return false;
-}
-
SwSidebarWin* SwPostItMgr::GetNextPostIt( USHORT aDirection,
SwSidebarWin* aPostIt )
{
@@ -1669,28 +1645,36 @@ void SwPostItMgr::CorrectPositions()
if (!pFirstPostIt)
return;
- // yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it
- const long aAnchorX = mpEditWin->LogicToPixel( Point((long)(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X();
- const long aAnchorY = mpEditWin->LogicToPixel( Point(0,(long)(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1;
- if (Point(aAnchorX,aAnchorY) != pFirstPostIt->GetPosPixel())
- {
- long aAnchorPosX = 0;
- long aAnchorPosY = 0;
- for (unsigned long n=0;n<mPages.size();n++)
- {
- for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
- {
- if ((*i)->bShow && (*i)->pPostIt)
- {
+ // yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it
+ // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists.
+ const long aAnchorX = pFirstPostIt->Anchor()
+ ? mpEditWin->LogicToPixel( Point((long)(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X()
+ : 0;
+ const long aAnchorY = pFirstPostIt->Anchor()
+ ? mpEditWin->LogicToPixel( Point(0,(long)(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1
+ : 0;
+ // <--
+ if (Point(aAnchorX,aAnchorY) != pFirstPostIt->GetPosPixel())
+ {
+ long aAnchorPosX = 0;
+ long aAnchorPosY = 0;
+ for (unsigned long n=0;n<mPages.size();n++)
+ {
+ for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++)
+ {
+ // --> OD 2010-06-03 #i111964# - check, if anchor overlay object exists.
+ if ( (*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->Anchor() )
+ // <--
+ {
aAnchorPosX = mPages[n]->eSidebarPosition == sw::sidebarwindows::SIDEBAR_LEFT
? mpEditWin->LogicToPixel( Point((long)((*i)->pPostIt->Anchor()->GetSeventhPosition().getX()),0)).X()
: mpEditWin->LogicToPixel( Point((long)((*i)->pPostIt->Anchor()->GetSixthPosition().getX()),0)).X();
aAnchorPosY = mpEditWin->LogicToPixel( Point(0,(long)((*i)->pPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1;
(*i)->pPostIt->SetPosPixel(Point(aAnchorPosX,aAnchorPosY));
}
- }
- }
- }
+ }
+ }
+ }
}
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index cce6db3a89..8caf11c84d 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -334,12 +334,6 @@ void SwSidebarWin::InitControls()
mpOutliner->SetUpdateMode( TRUE );
Rescale();
- OutputDevice* pDev = aShell->GetDoc()->getReferenceDevice(TRUE);
- if ( pDev )
- {
- mpOutliner->SetRefDevice( pDev );
- }
-
mpOutlinerView = new OutlinerView ( mpOutliner, mpSidebarTxtControl );
mpOutlinerView->SetBackgroundColor(COL_TRANSPARENT);
mpOutliner->InsertView(mpOutlinerView );
@@ -560,14 +554,28 @@ void SwSidebarWin::SetPosAndSize()
{
if (IsFollow() && !HasChildPathFocus())
{
- mpAnchor->SetAnchorState(AS_END);
+ // --> OD 2010-06-03 #i111964#
+ if ( mpAnchor )
+ {
+ mpAnchor->SetAnchorState(AS_END);
+ }
+ // <--
}
else
{
- mpAnchor->SetAnchorState(AS_ALL);
+ // --> OD 2010-06-03 #i111964#
+ if ( mpAnchor )
+ {
+ mpAnchor->SetAnchorState(AS_ALL);
+ }
+ // <--
SwSidebarWin* pWin = GetTopReplyNote();
- if (pWin)
+ // --> OD 2010-06-03 #i111964#
+ if ( pWin && pWin->Anchor() )
+ // <--
+ {
pWin->Anchor()->SetAnchorState(AS_END);
+ }
}
}
}
@@ -1127,8 +1135,12 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
{
mpAnchor->SetAnchorState(AS_ALL);
SwSidebarWin* pWin = GetTopReplyNote();
- if (pWin)
+ // --> OD 2010-06-03 #i111964#
+ if ( pWin && pWin->Anchor() )
+ // <--
+ {
pWin->Anchor()->SetAnchorState(AS_END);
+ }
mpAnchor->setLineSolid(true);
}
if (mpShadow)
@@ -1156,17 +1168,24 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
SwSidebarWin* pTopWinActive = mrMgr.HasActiveSidebarWin()
? mrMgr.GetActiveSidebarWin()->GetTopReplyNote()
: 0;
- if (pTopWinSelf && (pTopWinSelf!=pTopWinActive))
+ // --> OD 2010-06-03 #i111964#
+ if ( pTopWinSelf && ( pTopWinSelf != pTopWinActive ) &&
+ pTopWinSelf->Anchor() )
+ // <--
{
- if (pTopWinSelf!=mrMgr.GetActiveSidebarWin())
+ if ( pTopWinSelf != mrMgr.GetActiveSidebarWin() )
+ {
pTopWinSelf->Anchor()->setLineSolid(false);
+ }
pTopWinSelf->Anchor()->SetAnchorState(AS_ALL);
}
}
mpAnchor->setLineSolid(false);
}
- if (mpShadow)
+ if ( mpShadow )
+ {
mpShadow->SetShadowState(SS_NORMAL);
+ }
break;
}
}
diff --git a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
index 5628aed15b..cc7462f6d8 100644
--- a/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
+++ b/sw/source/ui/inc/SwSpellDialogChildWindow.hxx
@@ -48,8 +48,8 @@ class SwSpellDialogChildWindow
void LockFocusNotification(bool bLock);
protected:
- virtual svx::SpellPortions GetNextWrongSentence (void);
- virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged);
+ virtual svx::SpellPortions GetNextWrongSentence(bool bRecheck);
+ virtual void ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck);
virtual void AddAutoCorrection(const String& rOld, const String& rNew, LanguageType eLanguage);
virtual bool HasAutoCorrection();
virtual bool HasGrammarChecking();
diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index 382188f9e3..2fc7d153f8 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -91,6 +91,7 @@ class SwTransferable : public TransferableHelper
void DeleteSelection();
// helper methods for the paste
+ static SwTransferable* GetSwTransferable( const TransferableDataHelper& rData );
static void SetSelInShell( SwWrtShell& , BOOL , const Point* );
static BOOL _CheckForURLOrLNKFile( TransferableDataHelper& rData,
String& rFileName, String* pTitle = 0 );
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index eaa6551ec6..039f9ff32c 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -580,7 +580,7 @@ public:
BOOL HasDrwObj(SdrObject *pSdrObj) const;
BOOL HasOnlyObj(SdrObject *pSdrObj, UINT32 eObjInventor) const;
BOOL BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
- Window* pWin=NULL, BOOL bIsNewObj=FALSE);
+ Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
void StateTabWin(SfxItemSet&);
diff --git a/sw/source/ui/ribbar/makefile.mk b/sw/source/ui/ribbar/makefile.mk
index 72acc79307..2405d4b16d 100644
--- a/sw/source/ui/ribbar/makefile.mk
+++ b/sw/source/ui/ribbar/makefile.mk
@@ -45,6 +45,11 @@ SRC1FILES = \
tblctrl.src \
workctrl.src
+EXCEPTIONSFILES = \
+ $(SLO)$/tblctrl.obj \
+ $(SLO)$/tbxanchr.obj \
+ $(SLO)$/workctrl.obj
+
SLOFILES = \
$(SLO)$/inputwin.obj \
$(SLO)$/tbxanchr.obj \
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 19b149c20d..025403cc08 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -703,8 +703,9 @@ void SwBaseShell::Execute(SfxRequest &rReq)
rSh.EndSelect();
}
BOOL bRet = rSh.MoveFldType(pFldType, nSlot == FN_GOTO_NEXT_MARK);
- if (bRet)
- rSh.ClickToField(*rSh.GetCurFld());
+ SwField* pCurField = bRet ? rSh.GetCurFld() : 0;
+ if (pCurField)
+ rSh.ClickToField(*pCurField);
rReq.SetReturnValue(SfxBoolItem( nSlot, bRet));
}
}
diff --git a/sw/source/ui/shells/makefile.mk b/sw/source/ui/shells/makefile.mk
index e9a03a5a41..dce62a2c93 100644
--- a/sw/source/ui/shells/makefile.mk
+++ b/sw/source/ui/shells/makefile.mk
@@ -83,6 +83,7 @@ EXCEPTIONSFILES = \
$(SLO)$/drwtxtsh.obj \
$(SLO)$/frmsh.obj \
$(SLO)$/drwtxtex.obj \
+ $(SLO)$/slotadd.obj \
$(SLO)$/textsh1.obj
# --- Tagets -------------------------------------------------------
diff --git a/sw/source/ui/uiview/makefile.mk b/sw/source/ui/uiview/makefile.mk
index d06bb58a7d..337ee85da5 100644
--- a/sw/source/ui/uiview/makefile.mk
+++ b/sw/source/ui/uiview/makefile.mk
@@ -49,8 +49,13 @@ EXCEPTIONSFILES= \
$(SLO)$/swcli.obj \
$(SLO)$/uivwimp.obj \
$(SLO)$/view.obj \
+ $(SLO)$/view0.obj \
+ $(SLO)$/view1.obj \
$(SLO)$/view2.obj \
+ $(SLO)$/viewdraw.obj \
+ $(SLO)$/viewport.obj \
$(SLO)$/viewprt.obj \
+ $(SLO)$/viewsrch.obj \
$(SLO)$/viewling.obj \
$(SLO)$/viewmdi.obj \
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index aaa1e80808..d418216a39 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -599,15 +599,11 @@ void SwSrcView::GetState(SfxItemSet& rSet)
break;
case SID_PASTE:
{
- BOOL bDisable = 0 == SW_MOD()->pClipboard;
- if( bDisable )
- {
- TransferableDataHelper aDataHelper(
- TransferableDataHelper::CreateFromSystemClipboard(
- &aEditWin) );
- bDisable = !aDataHelper.GetXTransferable().is() ||
- 0 == aDataHelper.GetFormatCount();
- }
+ TransferableDataHelper aDataHelper(
+ TransferableDataHelper::CreateFromSystemClipboard(
+ &aEditWin) );
+ BOOL bDisable = !aDataHelper.GetXTransferable().is() ||
+ 0 == aDataHelper.GetFormatCount();
if( bDisable )
rSet.DisableItem(nWhich);
}
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 6bba1778e8..224ab55197 100644..100755
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -55,6 +55,7 @@
#include <editeng/langitem.hxx>
#include <svx/viewlayoutitem.hxx>
#include <svx/zoomslideritem.hxx>
+#include <svtools/xwindowitem.hxx>
#include <svx/htmlmode.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
@@ -538,11 +539,12 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
// xmlsec05: new password dialog
Window* pParent;
const SfxPoolItem* pParentItem;
- if( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_PARENTWINDOW, FALSE, &pParentItem ) )
- pParent = ( Window* ) ( ( const OfaPtrItem* ) pParentItem )->GetValue();
+ if( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) )
+ pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
SfxPasswordDialog aPasswdDlg( pParent );
+ aPasswdDlg.SetMinLen( 1 );
//#i69751# the result of Execute() can be ignored
aPasswdDlg.Execute();
String sNewPasswd( aPasswdDlg.GetPassword() );
@@ -574,11 +576,12 @@ void __EXPORT SwView::Execute(SfxRequest &rReq)
// message box for wrong password
Window* pParent;
const SfxPoolItem* pParentItem;
- if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_PARENTWINDOW, FALSE, &pParentItem ) )
- pParent = ( Window* ) ( ( const OfaPtrItem* ) pParentItem )->GetValue();
+ if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) )
+ pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
SfxPasswordDialog aPasswdDlg( pParent );
+ aPasswdDlg.SetMinLen( 1 );
if(!aPasswd.getLength())
aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM);
if (aPasswdDlg.Execute())
diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx
index f35e5570f1..49889a3daf 100644
--- a/sw/source/ui/uiview/viewdraw.cxx
+++ b/sw/source/ui/uiview/viewdraw.cxx
@@ -520,7 +520,8 @@ sal_Bool SwView::EnterDrawTextMode(const Point& aDocPos)
/******************************************************************************
* Beschreibung: DrawTextEditMode einschalten
******************************************************************************/
-sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin, sal_Bool bIsNewObj)
+sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
+ bool bIsNewObj, bool bSetSelectionToStart)
{
SwWrtShell *pSh = &GetWrtShell();
SdrView *pSdrView = pSh->GetDrawView();
@@ -606,7 +607,11 @@ sal_Bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, Window* pWin,
Color aBackground(pSh->GetShapeBackgrd());
pView->SetBackgroundColor(aBackground);
}
+
+ // editing should start at the end of text, spell checking at the beginning ...
ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
+ if (bSetSelectionToStart)
+ aNewSelection = ESelection();
pView->SetSelection(aNewSelection);
}
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index ff452ef209..20821d5d61 100644..100755
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -269,12 +269,10 @@ void SwView::GetState(SfxItemSet &rSet)
}
break;
case FN_REDLINE_ON:
- rSet.Put( SfxBoolItem( nWhich, (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0 ) );
- break;
+ rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
+ break;
case FN_REDLINE_PROTECT :
- {
- rSet.Put( SfxBoolItem( nWhich, pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0 ) );
- }
+ rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
break;
case FN_REDLINE_SHOW:
{
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index df8e740438..cbfe8617ad 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -122,8 +122,9 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_PROTECT_FORM,
HANDLE_TABS_RELATIVE_TO_INDENT,
// --> OD 2008-06-05 #i89181#
- HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST
+ HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
// <--
+ HANDLE_MODIFYPASSWORDINFO
};
MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -177,6 +178,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
{ RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0},
// --> OD 2008-06-05 #i89181#
{ RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0},
+ { RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
@@ -671,6 +673,21 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
break;
// <--
+ case HANDLE_MODIFYPASSWORDINFO:
+ {
+ uno::Sequence< beans::PropertyValue > aInfo;
+ if ( !( rValue >>= aInfo ) )
+ throw lang::IllegalArgumentException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value of type Sequence<PropertyValue> expected!" ) ),
+ uno::Reference< uno::XInterface >(),
+ 2 );
+
+ if ( !mpDocSh->SetModifyPasswordInfo( aInfo ) )
+ throw beans::PropertyVetoException(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The hash is not allowed to be changed now!" ) ),
+ uno::Reference< uno::XInterface >() );
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -998,6 +1015,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
}
break;
// <--
+ case HANDLE_MODIFYPASSWORDINFO:
+ {
+ rValue <<= mpDocSh->GetModifyPasswordInfo();
+ }
+ break;
default:
throw UnknownPropertyException();
diff --git a/sw/source/ui/uno/makefile.mk b/sw/source/ui/uno/makefile.mk
index 32210b2162..0023fd52f5 100644
--- a/sw/source/ui/uno/makefile.mk
+++ b/sw/source/ui/uno/makefile.mk
@@ -59,8 +59,7 @@ SLO1FILES = \
$(SLO)$/SwXFilterOptions.obj\
$(SLO)$/RefreshListenerContainer.obj \
$(SLO)$/unomodule.obj \
- $(SLO)$/unodoc.obj \
- $(SLO)$/warnpassword.obj
+ $(SLO)$/unodoc.obj
SLO2FILES = \
$(SLO)$/swdetect.obj \
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 95153b0019..5bbf2bdf07 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -167,7 +167,7 @@ SwFilterDetect::~SwFilterDetect()
lDescriptor[nProperty].Value >>= xInteraction;
nIndexOfInteractionHandler = nProperty;
}
- else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RapairPackage")) )
+ else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")) )
lDescriptor[nProperty].Value >>= bRepairPackage;
else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")) )
nIndexOfDocumentTitle = nProperty;
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index afc7581f78..e3f1322bed 100755
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -114,6 +114,8 @@
#include <drawdoc.hxx>
#include <SwStyleNameMapper.hxx>
#include <osl/file.hxx>
+#include <comphelper/storagehelper.hxx>
+
// --> FME 2004-06-08 #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
@@ -3152,16 +3154,13 @@ uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::
if(!IsValid())
throw RuntimeException();
//create a new document - hidden - copy the storage and return it
- SwDoc* pCopyDoc = pDocShell->GetDoc()->CreateCopy();
- SfxObjectShell* pShell = new SwDocShell( pCopyDoc, SFX_CREATE_MODE_STANDARD );
- pShell->DoInitNew();
-
- uno::Reference< embed::XStorage > xSourceStorage = getDocumentStorage();
+ SfxObjectShell* pShell = pDocShell->GetDoc()->CreateCopy(false);
uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
- //copy this storage
+ uno::Reference< embed::XStorage > xNewStorage = ::comphelper::OStorageHelper::GetTemporaryStorage( );
+ uno::Sequence< beans::PropertyValue > aTempMediaDescriptor;
+ storeToStorage( xNewStorage, aTempMediaDescriptor );
uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
- uno::Reference< embed::XStorage > xNewStorage = xStorageDoc->getDocumentStorage();
- xSourceStorage->copyToStorage( xNewStorage );
+ xStorageDoc->loadFromStorage( xNewStorage, aTempMediaDescriptor );
return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
}
/* -----------------------------20.06.00 09:54--------------------------------
diff --git a/sw/source/ui/uno/warnpassword.cxx b/sw/source/ui/uno/warnpassword.cxx
deleted file mode 100644
index 5eefdc23a1..0000000000
--- a/sw/source/ui/uno/warnpassword.cxx
+++ /dev/null
@@ -1,86 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-+ ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-// ============================================================================
-#include "warnpassword.hxx"
-#include <com/sun/star/task/XInteractionHandler.hpp>
-#include <svl/itemset.hxx>
-#include <sfx2/docfile.hxx>
-#include <sfx2/sfxsids.hrc>
-#include <ucbhelper/simpleinteractionrequest.hxx>
-#include <com/sun/star/ucb/InteractiveAppException.hpp>
-#include <svx/svxerr.hxx>
-
-using ::rtl::OUString;
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::ucb;
-using namespace ::com::sun::star::task;
-
-bool SwWarnPassword::WarningOnPassword( SfxMedium& rMedium )
-{
- bool bReturn = true;
- uno::Reference< task::XInteractionHandler > xHandler( rMedium.GetInteractionHandler());
- if( xHandler.is() )
- {
-
- OUString empty;
- uno::Any xException( makeAny(InteractiveAppException(empty,
- uno::Reference <XInterface> (),
- InteractionClassification_QUERY,
- ERRCODE_SVX_EXPORT_FILTER_CRYPT)));
-
- uno::Reference< ucbhelper::SimpleInteractionRequest > xRequest
- = new ucbhelper::SimpleInteractionRequest(
- xException,
- ucbhelper::CONTINUATION_APPROVE
- | ucbhelper::CONTINUATION_DISAPPROVE );
-
- xHandler->handle( xRequest.get() );
-
- const sal_Int32 nResp = xRequest->getResponse();
-
- switch ( nResp )
- {
- case ucbhelper::CONTINUATION_UNKNOWN:
- break;
-
- case ucbhelper::CONTINUATION_APPROVE:
- // Continue
- break;
-
- case ucbhelper::CONTINUATION_DISAPPROVE:
- bReturn = false;
- break;
- }
- }
- return bReturn;
-}
-
diff --git a/sw/source/ui/utlui/makefile.mk b/sw/source/ui/utlui/makefile.mk
index 7f2aa91c0e..cded61eee3 100644
--- a/sw/source/ui/utlui/makefile.mk
+++ b/sw/source/ui/utlui/makefile.mk
@@ -51,15 +51,15 @@ SRC1FILES = \
EXCEPTIONSFILES= \
$(SLO)$/bookctrl.obj \
+ $(SLO)$/glbltree.obj \
$(SLO)$/navipi.obj \
$(SLO)$/unotools.obj \
+ $(SLO)$/content.obj \
$(SLO)$/swrenamexnameddlg.obj
SLOFILES = $(EXCEPTIONSFILES) \
$(SLO)$/condedit.obj \
- $(SLO)$/content.obj \
$(SLO)$/gloslst.obj \
- $(SLO)$/glbltree.obj \
$(SLO)$/initui.obj \
$(SLO)$/navicfg.obj \
$(SLO)$/numfmtlb.obj \