summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rwxr-xr-x[-rw-r--r--]sw/source/ui/app/docsh.cxx77
-rw-r--r--sw/source/ui/app/swmodule.cxx1
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx109
-rw-r--r--sw/source/ui/docvw/AnchorOverlayObject.cxx2
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx40
-rw-r--r--[-rwxr-xr-x]sw/source/ui/docvw/SidebarWin.cxx45
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx1
-rw-r--r--sw/source/ui/uiview/srcview.cxx14
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/view2.cxx11
-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/swdetect.cxx2
12 files changed, 226 insertions, 108 deletions
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index c3f6585e325e..3c14ed6c46f0 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>
@@ -1367,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 4bf8238ade61..3f1c4665c6e3 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/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 704172b21074..8220c7ee2c8d 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 )
{
// 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
@@ -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 53afaf625710..5ed5b076a967 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 53770059cbcd..645d4773626a 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1645,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 cce6db3a891b..dc4f006e2026 100755..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/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index a239f13f1ec2..041b55d9c6db 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/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index c7c52e3f53ff..801ecba22c73 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 ced73b14ceff..eeab95b5bccd 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/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index c9fac035aa2b..40ba6e3c6d2d 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 63a674e0efad..b0ad816df4a1 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/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index c33d7428b630..cbde03479433 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;