You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2014/03/19 11:15:07 UTC
svn commit: r1579184 [29/33] - in /openoffice/branches/alg_writerframes: ./
ext_sources/ extras/l10n/source/de/ extras/l10n/source/es/
extras/l10n/source/eu/ extras/l10n/source/hi/ extras/l10n/source/kk/
extras/l10n/source/lt/ extras/l10n/source/nb/ ex...
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/shells/txtnum.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/shells/txtnum.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/shells/txtnum.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/shells/txtnum.cxx Wed Mar 19 10:14:42 2014
@@ -26,9 +26,7 @@
#include <hintids.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
#include <sfx2/request.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
@@ -50,7 +48,6 @@
#include <svx/nbdtmgfact.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
-using namespace svx::sidebar;
void SwTextShell::ExecEnterNum(SfxRequest &rReq)
{
@@ -115,334 +112,202 @@ void SwTextShell::ExecEnterNum(SfxReques
GetShell().EndAllAction();
}
break;
- case FN_NUMBER_BULLETS:
- case SID_OUTLINE_BULLET:
- {
- // --> OD 2008-02-29 #refactorlists#
-// // per default sal_True, damit die Schleife im Dialog richtig arbeitet!
-// sal_Bool bHasChild = sal_True;
- // <--
- SfxItemSet aSet(GetPool(),
- SID_HTML_MODE, SID_HTML_MODE,
- SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
- 0 );
- SwDocShell* pDocSh = GetView().GetDocShell();
- sal_Bool bHtml = 0 != PTR_CAST(SwWebDocShell, pDocSh);
- const SwNumRule* pCurRule = GetShell().GetCurNumRule();
- if( pCurRule )
- {
- SvxNumRule aRule = pCurRule->MakeSvxNumRule();
- //convert type of linked bitmaps from SVX_NUM_BITMAP to (SVX_NUM_BITMAP|LINK_TOKEN)
- for(sal_uInt16 i = 0; i < aRule.GetLevelCount(); i++)
- {
- SvxNumberFormat aFmt(aRule.GetLevel(i));
- if(SVX_NUM_BITMAP == aFmt.GetNumberingType())
- {
- const SvxBrushItem* pBrush = aFmt.GetBrush();
- const String* pLinkStr;
- if(pBrush &&
- 0 != (pLinkStr = pBrush->GetGraphicLink()) &&
- pLinkStr->Len())
- aFmt.SetNumberingType(SvxExtNumType(SVX_NUM_BITMAP|LINK_TOKEN));
- aRule.SetLevel(i, aFmt, aRule.Get(i) != 0);
- }
- }
- if(bHtml)
- aRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
+ case FN_NUMBER_BULLETS:
+ case SID_OUTLINE_BULLET:
+ {
+ SfxItemSet aSet( GetPool(),
+ SID_HTML_MODE, SID_HTML_MODE,
+ SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
+ 0 );
+ SwDocShell* pDocSh = GetView().GetDocShell();
+ const bool bHtml = 0 != PTR_CAST( SwWebDocShell, pDocSh );
+ const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection();
+ if ( pNumRuleAtCurrentSelection != NULL )
+ {
+ SvxNumRule aRule = pNumRuleAtCurrentSelection->MakeSvxNumRule();
+
+ //convert type of linked bitmaps from SVX_NUM_BITMAP to (SVX_NUM_BITMAP|LINK_TOKEN)
+ for ( sal_uInt16 i = 0; i < aRule.GetLevelCount(); i++ )
+ {
+ SvxNumberFormat aFmt( aRule.GetLevel( i ) );
+ if ( SVX_NUM_BITMAP == aFmt.GetNumberingType() )
+ {
+ const SvxBrushItem* pBrush = aFmt.GetBrush();
+ const String* pLinkStr = pBrush != NULL
+ ? pBrush->GetGraphicLink()
+ : NULL;
+ if ( pLinkStr != NULL && pLinkStr->Len() > 0 )
+ {
+ aFmt.SetNumberingType( SvxExtNumType( SVX_NUM_BITMAP | LINK_TOKEN ) );
+ }
+ aRule.SetLevel( i, aFmt, aRule.Get( i ) != 0 );
+ }
+ }
+ if ( bHtml )
+ aRule.SetFeatureFlag( NUM_ENABLE_EMBEDDED_BMP, sal_False );
- aSet.Put(SvxNumBulletItem(aRule));
- // --> OD 2008-02-29 #refactorlists# - removed <bHasChild>
+ aSet.Put( SvxNumBulletItem( aRule ) );
ASSERT( GetShell().GetNumLevel() < MAXLEVEL,
"<SwTextShell::ExecEnterNum()> - numbered node without valid list level. Serious defect -> please inform OD." );
sal_uInt16 nLevel = GetShell().GetNumLevel();
- // <--
- if( nLevel < MAXLEVEL )
- {
- nLevel = 1<<nLevel;
- aSet.Put( SfxUInt16Item( SID_PARAM_CUR_NUM_LEVEL, nLevel ));
- }
- }
- else
- {
- // --> OD 2008-02-11 #newlistlevelattrs#
+ if ( nLevel < MAXLEVEL )
+ {
+ nLevel = 1 << nLevel;
+ aSet.Put( SfxUInt16Item( SID_PARAM_CUR_NUM_LEVEL, nLevel ) );
+ }
+ }
+ else
+ {
SwNumRule aRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
- SvxNumRule aSvxRule = aRule.MakeSvxNumRule();
+ SvxNumRule aSvxRule = aRule.MakeSvxNumRule();
const bool bRightToLeft = GetShell().IsInRightToLeftText( 0 );
- if( bHtml || bRightToLeft )
- {
- for( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
- {
- SvxNumberFormat aFmt( aSvxRule.GetLevel( n ) );
+ if ( bHtml || bRightToLeft )
+ {
+ for ( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
+ {
+ SvxNumberFormat aFmt( aSvxRule.GetLevel( n ) );
if ( n && bHtml )
{
// 1/2" fuer HTML
- aFmt.SetLSpace(720);
- aFmt.SetAbsLSpace(n * 720);
+ aFmt.SetLSpace( 720 );
+ aFmt.SetAbsLSpace( n * 720 );
}
- // --> FME 2005-01-21 #i38904# Default alignment for
- // numbering/bullet should be rtl in rtl paragraph:
+ // Default alignment for numbering/bullet should be rtl in rtl paragraph:
if ( bRightToLeft )
{
aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
}
- // <--
aSvxRule.SetLevel( n, aFmt, sal_False );
- }
- aSvxRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
- }
- aSet.Put(SvxNumBulletItem(aSvxRule));
- }
+ }
+ aSvxRule.SetFeatureFlag( NUM_ENABLE_EMBEDDED_BMP, sal_False );
+ }
+ aSet.Put( SvxNumBulletItem( aSvxRule ) );
+ }
- aSet.Put( SfxBoolItem( SID_PARAM_NUM_PRESET,sal_False ));
+ aSet.Put( SfxBoolItem( SID_PARAM_NUM_PRESET, sal_False ) );
- // vor dem Dialog wird der HtmlMode an der DocShell versenkt
- pDocSh->PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(pDocSh)));
+ // vor dem Dialog wird der HtmlMode an der DocShell versenkt
+ pDocSh->PutItem( SfxUInt16Item( SID_HTML_MODE, ::GetHtmlMode( pDocSh ) ) );
- SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
- SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET,
- GetView().GetWindow(), &aSet, GetShell());
+ SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
+ DBG_ASSERT( pFact, "Dialogdiet fail!" );
+ SfxAbstractTabDialog* pDlg =
+ pFact->CreateSwTabDialog( DLG_SVXTEST_NUM_BULLET, GetView().GetWindow(), &aSet, GetShell() );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
- sal_uInt16 nRet = pDlg->Execute();
- const SfxPoolItem* pItem;
- if( RET_OK == nRet )
- {
- if( SFX_ITEM_SET == pDlg->GetOutputItemSet()->GetItemState( SID_ATTR_NUMBERING_RULE, sal_False, &pItem ))
- {
- rReq.AppendItem(*pItem);
- rReq.Done();
- SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
- pSetRule->UnLinkGraphics();
- // --> OD 2008-02-11 #newlistlevelattrs#
- SwNumRule aSetRule( pCurRule
- ? pCurRule->GetName()
- : GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
- numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
- aSetRule.SetSvxRule( *pSetRule, GetShell().GetDoc());
- aSetRule.SetAutoRule( sal_True );
- // --> OD 2008-03-17 #refactorlists#
+ const sal_uInt16 nRet = pDlg->Execute();
+ const SfxPoolItem* pItem;
+ if ( RET_OK == nRet )
+ {
+ if ( SFX_ITEM_SET == pDlg->GetOutputItemSet()->GetItemState( SID_ATTR_NUMBERING_RULE, sal_False, &pItem ) )
+ {
+ rReq.AppendItem( *pItem );
+ rReq.Done();
+ SvxNumRule* pSetRule = ( (SvxNumBulletItem*) pItem )->GetNumRule();
+ pSetRule->UnLinkGraphics();
+ SwNumRule aSetRule( pNumRuleAtCurrentSelection != NULL
+ ? pNumRuleAtCurrentSelection->GetName()
+ : GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+ aSetRule.SetSvxRule( *pSetRule, GetShell().GetDoc() );
+ aSetRule.SetAutoRule( sal_True );
// No start of new list, if an existing list style is edited.
// Otherwise start a new list.
- const bool bCreateList = (pCurRule == 0);
+ const bool bCreateList = ( pNumRuleAtCurrentSelection == NULL );
GetShell().SetCurNumRule( aSetRule, bCreateList );
- // <--
- }
- // wenn der Dialog mit OK verlassen wurde, aber nichts ausgewaehlt
- // wurde dann muss die Numerierung zumindest eingeschaltet werden,
- // wenn sie das noch nicht ist
- else if( !pCurRule && SFX_ITEM_SET == aSet.GetItemState( SID_ATTR_NUMBERING_RULE, sal_False, &pItem ))
- {
- rReq.AppendItem( *pItem );
- rReq.Done();
- SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
- // --> OD 2008-02-11 #newlistlevelattrs#
- SwNumRule aSetRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
- numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
- // <--
- aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc());
- aSetRule.SetAutoRule( sal_True );
- // --> OD 2008-03-17 #refactorlists#
+ }
+ // wenn der Dialog mit OK verlassen wurde, aber nichts ausgewaehlt
+ // wurde dann muss die Numerierung zumindest eingeschaltet werden,
+ // wenn sie das noch nicht ist
+ else if ( pNumRuleAtCurrentSelection == NULL
+ && SFX_ITEM_SET == aSet.GetItemState( SID_ATTR_NUMBERING_RULE, sal_False, &pItem ) )
+ {
+ rReq.AppendItem( *pItem );
+ rReq.Done();
+ SvxNumRule* pSetRule = ( (SvxNumBulletItem*) pItem )->GetNumRule();
+ SwNumRule aSetRule(
+ GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+ aSetRule.SetSvxRule( *pSetRule, GetShell().GetDoc() );
+ aSetRule.SetAutoRule( sal_True );
// start new list
GetShell().SetCurNumRule( aSetRule, true );
- // <--
- }
- }
- else if(RET_USER == nRet)
- GetShell().DelNumRules();
-
- delete pDlg;
- }
- break;
- default:
- ASSERT(sal_False, falscher Dispatcher);
- return;
- }
+ }
+ }
+ else if ( RET_USER == nRet )
+ GetShell().DelNumRules();
+
+ delete pDlg;
+ }
+ break;
+
+ default:
+ ASSERT( sal_False, "wrong Dispatcher" );
+ return;
+ }
}
-void SwTextShell::ExecSetNumber(SfxRequest &rReq)
-{
- SwNumRule aRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
- numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
-
- SvxNumRule aSvxRule = aRule.MakeSvxNumRule();
- const bool bRightToLeft = GetShell().IsInRightToLeftText( 0 );
- if( bRightToLeft )
- {
- for( sal_uInt8 n = 0; n < MAXLEVEL; ++n )
- {
- SvxNumberFormat aFmt( aSvxRule.GetLevel( n ) );
- /* if ( n && bHtml )
- {
- // 1/2" fuer HTML
- aFmt.SetLSpace(720);
- aFmt.SetAbsLSpace(n * 720);
- }*/
- // --> FME 2005-01-21 #i38904# Default alignment for
- // numbering/bullet should be rtl in rtl paragraph:
- if ( bRightToLeft )
+void SwTextShell::ExecSetNumber(SfxRequest &rReq)
+{
+ const sal_uInt16 nSlot = rReq.GetSlot();
+ switch ( nSlot )
+ {
+ case FN_SVX_SET_NUMBER:
+ case FN_SVX_SET_BULLET:
+ {
+ SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, nSlot, sal_False );
+ if ( pItem != NULL )
{
- aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
+ const sal_uInt16 nChoosenItemIdx = pItem->GetValue();
+ if ( nChoosenItemIdx == DEFAULT_NONE )
+ {
+ GetShell().DelNumRules();
+ }
+ else
+ {
+ svx::sidebar::NBOTypeMgrBase* pNBOTypeMgr =
+ nSlot == FN_SVX_SET_NUMBER
+ ? svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::NUMBERING )
+ : svx::sidebar::NBOutlineTypeMgrFact::CreateInstance( svx::sidebar::eNBOType::MIXBULLETS );
+ if ( pNBOTypeMgr != NULL )
+ {
+ const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection();
+ sal_uInt16 nActNumLvl = (sal_uInt16) 0xFFFF;
+ if ( pNumRuleAtCurrentSelection != NULL )
+ {
+ sal_uInt16 nLevel = GetShell().GetNumLevel();
+ if ( nLevel < MAXLEVEL )
+ {
+ nActNumLvl = 1 << nLevel;
+ }
+ }
+ SwNumRule aNewNumRule(
+ pNumRuleAtCurrentSelection != NULL ? pNumRuleAtCurrentSelection->GetName() : GetShell().GetUniqueNumRuleName(),
+ numfunc::GetDefaultPositionAndSpaceMode() );
+ SvxNumRule aNewSvxNumRule = pNumRuleAtCurrentSelection != NULL
+ ? pNumRuleAtCurrentSelection->MakeSvxNumRule()
+ : aNewNumRule.MakeSvxNumRule();
+ // set unit attribute to NB Manager
+ SfxItemSet aSet( GetPool(), SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL, 0 );
+ aSet.Put( SvxNumBulletItem( aNewSvxNumRule ) );
+ pNBOTypeMgr->SetItems( &aSet );
+ pNBOTypeMgr->ApplyNumRule( aNewSvxNumRule, nChoosenItemIdx - 1, nActNumLvl );
+
+ aNewNumRule.SetSvxRule( aNewSvxNumRule, GetShell().GetDoc() );
+ aNewNumRule.SetAutoRule( sal_True );
+ const bool bCreateNewList = ( pNumRuleAtCurrentSelection == NULL );
+ GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
+ }
+ }
}
- // <--
- aSvxRule.SetLevel( n, aFmt, sal_False );
- }
- aSvxRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
- }
-
- const SwNumRule* pCurRule = GetShell().GetCurNumRule();
- sal_uInt16 nActNumLvl = (sal_uInt16)0xFFFF;
- if( pCurRule )
- {
- sal_uInt16 nLevel = GetShell().GetNumLevel();
- if( nLevel < MAXLEVEL )
- {
- nActNumLvl = 1<<nLevel;
- }
-
- aSvxRule = pCurRule->MakeSvxNumRule();
+ }
+ break;
- //convert type of linked bitmaps from SVX_NUM_BITMAP to (SVX_NUM_BITMAP|LINK_TOKEN)
- for(sal_uInt16 i = 0; i < aSvxRule.GetLevelCount(); i++)
- {
- SvxNumberFormat aFmt(aSvxRule.GetLevel(i));
- if(SVX_NUM_BITMAP == aFmt.GetNumberingType())
- {
- const SvxBrushItem* pBrush = aFmt.GetBrush();
- const String* pLinkStr;
- if(pBrush &&
- 0 != (pLinkStr = pBrush->GetGraphicLink()) &&
- pLinkStr->Len())
- aFmt.SetNumberingType(SvxExtNumType(SVX_NUM_BITMAP|LINK_TOKEN));
- aSvxRule.SetLevel(i, aFmt, aSvxRule.Get(i) != 0);
- }
- }
- }
-
-
- switch(rReq.GetSlot())
- {
- case FN_SVX_SET_NUMBER:
- {
- SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, FN_SVX_SET_NUMBER , sal_False );
- if (pItem)
- {
- sal_uInt16 nIdx = pItem->GetValue();
- if (nIdx==DEFAULT_NONE) {
- GetShell().DelNumRules();
- break;
- }
- --nIdx;
-
- NBOTypeMgrBase* pNumbering = NBOutlineTypeMgrFact::CreateInstance(eNBOType::NUMBERING);
- if ( pNumbering )
- {
- SwNumRule aTmpRule( GetShell().GetUniqueNumRuleName(),
- numfunc::GetDefaultPositionAndSpaceMode() );
-
- SvxNumRule aTempRule = aTmpRule.MakeSvxNumRule();
- // set unit attribute to NB Manager
- SfxItemSet aSet(GetPool(),
- SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
- 0 );
- aSet.Put(SvxNumBulletItem(aTempRule));
- pNumbering->SetItems(&aSet);
- pNumbering->ApplyNumRule(aTempRule,nIdx,nActNumLvl);
-
- sal_uInt16 nMask = 1;
- for(sal_uInt16 i = 0; i < aSvxRule.GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aFmt(aTempRule.GetLevel(i));
- aSvxRule.SetLevel(i, aFmt);
- }
- nMask <<= 1 ;
- }
-
- aSvxRule.UnLinkGraphics();
- SwNumRule aSetRule( pCurRule
- ? pCurRule->GetName()
- : GetShell().GetUniqueNumRuleName(),
- numfunc::GetDefaultPositionAndSpaceMode() );
- aSetRule.SetSvxRule( aSvxRule, GetShell().GetDoc());
-
- aSetRule.SetAutoRule( sal_True );
- const bool bCreateList = (pCurRule == 0);
- GetShell().SetCurNumRule( aSetRule, bCreateList );
- }
- //End
- }
- break;
- }
- case FN_SVX_SET_BULLET:
- {
- SFX_REQUEST_ARG( rReq, pItem, SfxUInt16Item, FN_SVX_SET_BULLET , sal_False );
- if (pItem)
- {
- sal_uInt16 nIdx = pItem->GetValue();
- if (nIdx==DEFAULT_NONE) {
- GetShell().DelNumRules();
- break;
- }
- nIdx--;
-
- NBOTypeMgrBase* pBullets = NBOutlineTypeMgrFact::CreateInstance(eNBOType::MIXBULLETS);
- if ( pBullets )
- {
- SwNumRule aTmpRule( GetShell().GetUniqueNumRuleName(),
- numfunc::GetDefaultPositionAndSpaceMode() );
-
- SvxNumRule aTempRule = aTmpRule.MakeSvxNumRule();
- // set unit attribute to NB Manager
- SfxItemSet aSet(GetPool(),
- SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL,
- 0 );
- aSet.Put(SvxNumBulletItem(aTempRule));
- pBullets->SetItems(&aSet);
-
- //SvxNumRule aTempRule( 0, 10, false );
- pBullets->ApplyNumRule(aTempRule,nIdx,nActNumLvl);
- sal_uInt16 nMask = 1;
- for(sal_uInt16 i = 0; i < aSvxRule.GetLevelCount(); i++)
- {
- if(nActNumLvl & nMask)
- {
- SvxNumberFormat aFmt(aTempRule.GetLevel(i));
- aSvxRule.SetLevel(i, aFmt);
- }
- nMask <<= 1;
- }
- aSvxRule.UnLinkGraphics();
-
- SwNumRule aSetRule( pCurRule
- ? pCurRule->GetName()
- : GetShell().GetUniqueNumRuleName(),
- numfunc::GetDefaultPositionAndSpaceMode() );
-
- aSetRule.SetSvxRule( aSvxRule, GetShell().GetDoc());
-
- aSetRule.SetAutoRule( sal_True );
- const bool bCreateList = (pCurRule == 0);
- GetShell().SetCurNumRule( aSetRule, bCreateList );
- }
- //End
- }
-
- }
- break;
- }
+ default:
+ ASSERT( sal_False, "wrong Dispatcher" );
+ return;
+ }
}
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/formatclipboard.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/formatclipboard.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/formatclipboard.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/formatclipboard.cxx Wed Mar 19 10:14:42 2014
@@ -397,7 +397,7 @@ void SwFormatClipboard::Copy( SwWrtShell
rWrtShell.GetCurAttr(*pItemSet);
// additional numbering properties for paragraph styles
- if( nSelectionType & nsSelectionType::SEL_TXT && rWrtShell.GetCurNumRule() )
+ if( nSelectionType & nsSelectionType::SEL_TXT && rWrtShell.GetNumRuleAtCurrCrsrPos() )
{
SfxBoolItem aStart(FN_NUMBER_NEWSTART, rWrtShell.IsNumRuleStart());
pItemSet->Put(aStart);
@@ -553,7 +553,7 @@ void SwFormatClipboard::Paste( SwWrtShel
rWrtShell.SetAttrSet(*pTemplateItemSet);
// additional numbering properties for paragraph styles
- if( nSelectionType & nsSelectionType::SEL_TXT && rWrtShell.GetCurNumRule() )
+ if( nSelectionType & nsSelectionType::SEL_TXT && rWrtShell.GetNumRuleAtCurrCrsrPos() )
{
if( SFX_ITEM_SET == pTemplateItemSet->GetItemState(FN_NUMBER_NEWSTART) )
{
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/view2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/view2.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/view2.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/view2.cxx Wed Mar 19 10:14:42 2014
@@ -209,7 +209,7 @@ int SwView::InsertGraphic( const String
sal_Bool bLink, GraphicFilter *pFlt,
Graphic* pPreviewGrf, sal_Bool bRule )
{
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
Graphic aGrf;
int nRes = GRFILTER_OK;
@@ -225,27 +225,44 @@ int SwView::InsertGraphic( const String
if( GRFILTER_OK == nRes )
{
SwFlyFrmAttrMgr aFrmMgr( sal_True, GetWrtShellPtr(), FRMMGR_TYPE_GRF );
-
SwWrtShell &rSh = GetWrtShell();
- rSh.StartAction();
- if( bLink )
- {
- SwDocShell* pDocSh = GetDocShell();
- INetURLObject aTemp(
- pDocSh->HasName() ?
- pDocSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) :
- rtl::OUString());
- String sURL = URIHelper::SmartRel2Abs(
- aTemp, rPath, URIHelper::GetMaybeFileHdl() );
+ // #123922# determine if we really want to insert or replace the graphic at a selected object
+ const bool bReplaceMode(rSh.HasSelection() && nsSelectionType::SEL_FRM == rSh.GetSelectionType());
- rSh.Insert( sURL,
- rFilter, aGrf, &aFrmMgr, bRule );
+ if(bReplaceMode)
+ {
+ // #123922# Do same as in D&D, ReRead graphic and all is done
+ rSh.ReRead(
+ bLink ? rPath : String(),
+ bLink ? rFilter : String(),
+ &aGrf);
}
else
- rSh.Insert( aEmptyStr, aEmptyStr, aGrf, &aFrmMgr );
- // nach dem EndAction ist es zu spaet, weil die Shell dann schon zerstoert sein kann
- rSh.EndAction();
+ {
+ rSh.StartAction();
+ if( bLink )
+ {
+ SwDocShell* pDocSh = GetDocShell();
+ INetURLObject aTemp(
+ pDocSh->HasName() ?
+ pDocSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) :
+ rtl::OUString());
+
+ String sURL = URIHelper::SmartRel2Abs(
+ aTemp, rPath, URIHelper::GetMaybeFileHdl() );
+
+ rSh.Insert( sURL,
+ rFilter, aGrf, &aFrmMgr, bRule );
+ }
+ else
+ {
+ rSh.Insert( aEmptyStr, aEmptyStr, aGrf, &aFrmMgr );
+ }
+
+ // nach dem EndAction ist es zu spaet, weil die Shell dann schon zerstoert sein kann
+ rSh.EndAction();
+ }
}
return nRes;
}
@@ -408,6 +425,9 @@ sal_Bool SwView::InsertGraphicDlg( SfxRe
SwRewriter aRewriter;
aRewriter.AddRule(UNDO_ARG1, String(SW_RES(STR_GRAPHIC_DEFNAME)));
+ // #123922# determine if we really want to insert or replace the graphic at a selected object
+ const bool bReplaceMode(rSh.HasSelection() && nsSelectionType::SEL_FRM == rSh.GetSelectionType());
+
rSh.StartUndo(UNDO_INSERT, &aRewriter);
int nError = InsertGraphic( aFileName, aFilterName, bAsLink, GraphicFilter::GetGraphicFilter() );
@@ -415,7 +435,10 @@ sal_Bool SwView::InsertGraphicDlg( SfxRe
// Format ist ungleich Current Filter, jetzt mit auto. detection
if( nError == GRFILTER_FORMATERROR )
nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, GraphicFilter::GetGraphicFilter() );
- if ( rSh.IsFrmSelected() )
+
+ // #123922# no new FrameFormat for replace mode, only when new object was created,
+ // else this would reset the current setting for the frame holding the graphic
+ if ( !bReplaceMode && rSh.IsFrmSelected() )
{
SwFrmFmt* pFmt = pDoc->FindFrmFmtByName( sGraphicFormat );
if(!pFmt)
@@ -1450,7 +1473,7 @@ void SwView::StateStatusLine(SfxItemSet
//}//<-removed end ,zhaojianwei
//-->#outline level,added by zhaojianwei
- const SwNumRule* pNumRule = rShell.GetCurNumRule();
+ const SwNumRule* pNumRule = rShell.GetNumRuleAtCurrCrsrPos();
const bool bOutlineNum = pNumRule ? pNumRule->IsOutlineRule() : 0;
//((SwTxtFmtColl*)rShell.GetCrsr()->GetNode()->GetTxtNode()->GetFmtColl())->IsAssignedToListLevelOfOutlineStyle();
@@ -1716,7 +1739,7 @@ void SwView::ExecuteStatusLine(SfxReques
nId = FN_EDIT_REGION;
else
{
- const SwNumRule* pNumRule = rSh.GetCurNumRule();
+ const SwNumRule* pNumRule = rSh.GetNumRuleAtCurrCrsrPos();
if( pNumRule ) // Cursor in Numerierung
{
if( pNumRule->IsAutoRule() )
@@ -2123,7 +2146,7 @@ long SwView::InsertMedium( sal_uInt16 nS
sal_uLong nErrno;
{ //Scope for SwWait-Object, to be able to execute slots
//outside this scope.
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
pWrtShell->StartAllAction();
if ( pWrtShell->HasSelection() )
pWrtShell->DelRight(); // Selektionen loeschen
@@ -2183,7 +2206,7 @@ extern int lcl_FindDocShell( SfxObjectSh
sFltNm, nVersion, pDocSh );
if( nRet )
{
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
pWrtShell->StartAllAction();
pWrtShell->EnterStdMode(); // Selektionen loeschen
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewling.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewling.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewling.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewling.cxx Wed Mar 19 10:14:42 2014
@@ -626,7 +626,7 @@ void SwView::StartThesaurus()
{
// create dialog
{ //Scope for SwWait-Object
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
// load library with dialog only on demand ...
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
pDlg = pFact->CreateThesaurusDialog( &GetEditWin(), xThes, aTmp, eLang );
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewsrch.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewsrch.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewsrch.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/uiview/viewsrch.cxx Wed Mar 19 10:14:42 2014
@@ -335,7 +335,7 @@ void SwView::ExecSearch(SfxRequest& rReq
sal_uLong nFound;
{ //Scope for SwWait-Object
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
pWrtShell->StartAllAction();
nFound = FUNC_Search( aOpts );
pWrtShell->EndAllAction();
@@ -479,7 +479,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool
if (!pSrchItem->GetSelection())
(pWrtShell->*pWrtShell->fnKillSel)(0, sal_False);
- SwWait *pWait = new SwWait( *GetDocShell(), sal_True );
+ SwWait *pWait = new SwWait( *GetDocShell(), true );
if( FUNC_Search( aOpts ) )
{
bFound = sal_True;
@@ -546,7 +546,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool
}
pWrtShell->StartAllAction();
pWrtShell->Pop(sal_False);
- pWait = new SwWait( *GetDocShell(), sal_True );
+ pWait = new SwWait( *GetDocShell(), true );
sal_Bool bSrchBkwrd = DOCPOS_START == aOpts.eEnd;
@@ -578,7 +578,7 @@ sal_Bool SwView::SearchAndWrap(sal_Bool
sal_Bool SwView::SearchAll(sal_uInt16* pFound)
{
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
pWrtShell->StartAllAction();
SwSearchOptions aOpts( pWrtShell, pSrchItem->GetBackward() );
@@ -607,7 +607,7 @@ sal_Bool SwView::SearchAll(sal_uInt16* p
void SwView::Replace()
{
- SwWait aWait( *GetDocShell(), sal_True );
+ SwWait aWait( *GetDocShell(), true );
pWrtShell->StartAllAction();
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/attrdesc.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/attrdesc.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/attrdesc.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/attrdesc.cxx Wed Mar 19 10:14:42 2014
@@ -388,6 +388,7 @@ SfxItemPresentation SwFmtFrmSize::GetPre
else
{
rText += ::GetMetricText( GetWidth(), eCoreUnit, ePresUnit, pIntl );
+ rText += sal_Unicode(' ');
rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
}
if ( ATT_VAR_SIZE != GetHeightSizeType() )
@@ -406,6 +407,7 @@ SfxItemPresentation SwFmtFrmSize::GetPre
else
{
rText += ::GetMetricText( GetHeight(), eCoreUnit, ePresUnit, pIntl );
+ rText += sal_Unicode(' ');
rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
}
}
@@ -562,6 +564,7 @@ SfxItemPresentation SwFmtVertOrient::Get
rText += SW_RESSTR( STR_POS_Y );
rText += ' ';
rText += ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl );
+ rText += sal_Unicode(' ');
rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
}
break;
@@ -623,6 +626,7 @@ SfxItemPresentation SwFmtHoriOrient::Get
rText += SW_RESSTR( STR_POS_X );
rText += ' ';
rText += ::GetMetricText( GetPos(), eCoreUnit, ePresUnit, pIntl );
+ rText += sal_Unicode(' ');
rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
}
break;
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/uiitems.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/uiitems.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/uiitems.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/utlui/uiitems.cxx Wed Mar 19 10:14:42 2014
@@ -110,6 +110,7 @@ SfxItemPresentation SwPageFtnInfoItem::
rText = SW_RESSTR( STR_MAX_FTN_HEIGHT );
rText += ' ';
rText += ::GetMetricText( nHght, eCoreUnit, ePresUnit, pIntl );
+ rText += sal_Unicode(' ');
rText += ::GetSvxString( ::GetMetricId( ePresUnit ) );
}
return ePres;
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh1.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh1.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh1.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh1.cxx Wed Mar 19 10:14:42 2014
@@ -182,17 +182,17 @@ sal_Bool SwWrtShell::IsEndWrd()
Beschreibung: Abfrage, ob Einfuegen moeglich ist; gfs. Beep
------------------------------------------------------------------------*/
-
-
-sal_Bool SwWrtShell::_CanInsert()
+bool SwWrtShell::_CanInsert()
{
- if(!CanInsert())
- {
- Sound::Beep();
- return sal_False;
- }
- return sal_True;
+ if(!CanInsert())
+ {
+ Sound::Beep();
+ return false;
+ }
+
+ return true;
}
+
/*------------------------------------------------------------------------
Beschreibung: String einfuegen
------------------------------------------------------------------------*/
@@ -1076,7 +1076,7 @@ void SwWrtShell::SplitNode( sal_Bool bAu
void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
{
// determine numbering rule found at current cursor position in the docment.
- const SwNumRule* pCurRule = GetCurNumRule();
+ const SwNumRule* pCurRule = GetNumRuleAtCurrCrsrPos();
StartUndo(UNDO_NUMORNONUM);
@@ -1433,7 +1433,7 @@ void SwWrtShell::NumOn()
void SwWrtShell::NumOrBulletOff()
{
- const SwNumRule * pCurNumRule = GetCurNumRule();
+ const SwNumRule * pCurNumRule = GetNumRuleAtCurrCrsrPos();
if (pCurNumRule)
{
@@ -1551,7 +1551,7 @@ SelectionType SwWrtShell::GetSelectionTy
nCnt |= (nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS);
// Do not pop up numbering toolbar, if the text node has a numbering of type SVX_NUM_NUMBER_NONE.
- const SwNumRule* pNumRule = GetCurNumRule();
+ const SwNumRule* pNumRule = GetNumRuleAtCurrCrsrPos();
if ( pNumRule )
{
const SwTxtNode* pTxtNd =
@@ -1820,9 +1820,36 @@ sal_Bool SwWrtShell::Pop( sal_Bool bOldC
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
-sal_Bool SwWrtShell::CanInsert()
+bool SwWrtShell::CanInsert()
{
- return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
+ // #123922# The original expression looks sleek, but it is not. Using the mathematical or ('|')
+ // instead of the logical one ('||') forces the compiler to evaluate all conditions to allow or-ing
+ // them together (yes, he could do better). Using the logical or allows to return on the first
+ // failing statement instead.
+ //
+ // return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
+
+ if(IsSelFrmMode())
+ {
+ return false;
+ }
+
+ if(IsObjSelected())
+ {
+ return false;
+ }
+
+ if(GetView().GetDrawFuncPtr())
+ {
+ return false;
+ }
+
+ if(GetView().GetPostItMgr()->GetActiveSidebarWin())
+ {
+ return false;
+ }
+
+ return true;
}
Modified: openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh2.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh2.cxx (original)
+++ openoffice/branches/alg_writerframes/main/sw/source/ui/wrtsh/wrtsh2.cxx Wed Mar 19 10:14:42 2014
@@ -94,10 +94,23 @@ void SwWrtShell::Insert( SwField& rFld )
{
// for annotation fields:
// - keep the current selection in order to create a corresponding annotation mark
- // - collapse cursur to its point
- const SwPaM& rCurrPaM = GetCurrentShellCursor();
- pAnnotationTextRange = new SwPaM( *rCurrPaM.GetPoint(), *rCurrPaM.GetMark() );
- ClearMark();
+ // - collapse cursor to its end
+ if ( IsTableMode() )
+ {
+ GetTblCrs()->Normalize( sal_False );
+ const SwPosition rStartPos( *(GetTblCrs()->GetMark()->nNode.GetNode().GetCntntNode()), 0 );
+ KillPams();
+ EndPara();
+ const SwPosition rEndPos( *GetCurrentShellCursor().GetPoint() );
+ pAnnotationTextRange = new SwPaM( rStartPos, rEndPos );
+ }
+ else
+ {
+ NormalizePam( sal_False );
+ const SwPaM& rCurrPaM = GetCurrentShellCursor();
+ pAnnotationTextRange = new SwPaM( *rCurrPaM.GetPoint(), *rCurrPaM.GetMark() );
+ ClearMark();
+ }
}
else
{
Modified: openoffice/branches/alg_writerframes/main/sysui/desktop/macosx/Info.plist
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sysui/desktop/macosx/Info.plist?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sysui/desktop/macosx/Info.plist (original)
+++ openoffice/branches/alg_writerframes/main/sysui/desktop/macosx/Info.plist Wed Mar 19 10:14:42 2014
@@ -22,6 +22,8 @@
***********************************************************-->
<plist version="1.0">
<dict>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.7.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<!-- UTI declarations for OS X >= 10.4 -->
Modified: openoffice/branches/alg_writerframes/main/sysui/desktop/productversion.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/sysui/desktop/productversion.mk?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/sysui/desktop/productversion.mk (original)
+++ openoffice/branches/alg_writerframes/main/sysui/desktop/productversion.mk Wed Mar 19 10:14:42 2014
@@ -47,7 +47,7 @@ PRODUCTLIST = openoffice
# default values to minimize maintainance effort
# CAUTION! $(OOOBASEVERSION) from openoffice.lst NOT available (!)
-PRODUCTVERSION = 4.0
+PRODUCTVERSION = 4.1
# CAUTION! $(BRANDPACKAGEVERSION) from openoffice.lst NOT available (!)
PRODUCTVERSIONSHORT = 4
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCallbacks.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCallbacks.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCallbacks.hxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCallbacks.hxx Wed Mar 19 10:14:42 2014
@@ -23,7 +23,7 @@
#ifndef INCLUDED_CALLBACKS_HXX
#define INCLUDED_CALLBACKS_HXX
-#include <serf.h>
+#include <serf/serf.h>
extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
serf_bucket_t **read_bkt,
@@ -37,8 +37,8 @@ extern "C" apr_status_t Serf_Credentials
void *baton,
int code,
const char *authn_type,
- const char *realm,
- apr_pool_t *pool );
+ const char *realm,
+ apr_pool_t *pool );
extern "C" apr_status_t Serf_CertificateChainValidation(
void* pSerfSession,
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx Wed Mar 19 10:14:42 2014
@@ -24,7 +24,7 @@
#include "SerfCopyReqProcImpl.hxx"
-#include <serf.h>
+#include <serf/serf.h>
namespace http_dav_ucp
{
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx Wed Mar 19 10:14:42 2014
@@ -24,7 +24,7 @@
#include "SerfDeleteReqProcImpl.hxx"
-#include <serf.h>
+#include <serf/serf.h>
namespace http_dav_ucp
{
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx Wed Mar 19 10:14:42 2014
@@ -24,7 +24,7 @@
#include "SerfMkColReqProcImpl.hxx"
-#include <serf.h>
+#include <serf/serf.h>
namespace http_dav_ucp
{
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx Wed Mar 19 10:14:42 2014
@@ -24,7 +24,7 @@
#include "SerfMoveReqProcImpl.hxx"
-#include <serf.h>
+#include <serf/serf.h>
namespace http_dav_ucp
{
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx Wed Mar 19 10:14:42 2014
@@ -24,7 +24,7 @@
#include "SerfPostReqProcImpl.hxx"
-#include <serf.h>
+#include <serf/serf.h>
using namespace com::sun::star;
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx Wed Mar 19 10:14:42 2014
@@ -26,7 +26,7 @@
#include "SerfPutReqProcImpl.hxx"
-#include <serf.h>
+#include <serf/serf.h>
namespace http_dav_ucp
{
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessor.hxx Wed Mar 19 10:14:42 2014
@@ -26,7 +26,7 @@
#include <apr_errno.h>
#include <apr_pools.h>
-#include <serf.h>
+#include <serf/serf.h>
#include "DAVTypes.hxx"
#include "DAVResource.hxx"
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx Wed Mar 19 10:14:42 2014
@@ -22,7 +22,7 @@
#ifndef INCLUDED_SERFREQUESTPROCESSORIMPL_HXX
#define INCLUDED_SERFREQUESTPROCESSORIMPL_HXX
-#include <serf.h>
+#include <serf/serf.h>
#include <sal/types.h>
#include "DAVRequestEnvironment.hxx"
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfSession.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfSession.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfSession.cxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfSession.cxx Wed Mar 19 10:14:42 2014
@@ -30,7 +30,7 @@
#include "ucbhelper/simplecertificatevalidationrequest.hxx"
#include "AprEnv.hxx"
-#include <apr_strings.h>
+#include <apr/apr_strings.h>
#include "DAVAuthListener.hxx"
#include "SerfTypes.hxx"
@@ -47,6 +47,10 @@
#include <com/sun/star/security/CertificateContainerStatus.hpp>
#include <com/sun/star/security/CertificateContainer.hpp>
#include <com/sun/star/security/XCertificateContainer.hpp>
+#include <com/sun/star/security/CertAltNameEntry.hpp>
+#include <com/sun/star/security/XSanExtension.hpp>
+#define OID_SUBJECT_ALTERNATIVE_NAME "2.5.29.17"
+
#include <com/sun/star/ucb/Lock.hpp>
#include <com/sun/star/xml/crypto/XSEInitializer.hpp>
@@ -479,7 +483,40 @@ apr_status_t SerfSession::verifySerfCert
// When the certificate matches the host name then we can use the
// result of the verification.
- if (isDomainMatch(sServerCertificateSubject))
+ bool bHostnameMatchesCertHostnames = false;
+ {
+ uno::Sequence< uno::Reference< security::XCertificateExtension > > extensions = xServerCertificate->getExtensions();
+ uno::Sequence< security::CertAltNameEntry > altNames;
+ for (sal_Int32 i = 0 ; i < extensions.getLength(); ++i)
+ {
+ uno::Reference< security::XCertificateExtension >element = extensions[i];
+
+ const rtl::OString aId ( (const sal_Char *)element->getExtensionId().getArray(), element->getExtensionId().getLength());
+ if ( aId.equals( OID_SUBJECT_ALTERNATIVE_NAME ) )
+ {
+ uno::Reference< security::XSanExtension > sanExtension ( element, uno::UNO_QUERY );
+ altNames = sanExtension->getAlternativeNames();
+ break;
+ }
+ }
+
+ uno::Sequence< ::rtl::OUString > certHostNames(altNames.getLength() + 1);
+ certHostNames[0] = sServerCertificateSubject;
+ for( int n = 0; n < altNames.getLength(); ++n )
+ {
+ if (altNames[n].Type == security::ExtAltNameType_DNS_NAME)
+ {
+ altNames[n].Value >>= certHostNames[n+1];
+ }
+ }
+
+ for ( int i = 0; i < certHostNames.getLength() && !bHostnameMatchesCertHostnames; ++i )
+ {
+ bHostnameMatchesCertHostnames = isDomainMatch( certHostNames[i] );
+ }
+
+ }
+ if ( bHostnameMatchesCertHostnames )
{
if (nVerificationResult == 0)
@@ -526,8 +563,7 @@ apr_status_t SerfSession::verifySerfCert
if ( xSelection.is() )
{
- uno::Reference< task::XInteractionApprove > xApprove(
- xSelection.get(), uno::UNO_QUERY );
+ uno::Reference< task::XInteractionApprove > xApprove( xSelection.get(), uno::UNO_QUERY );
if ( xApprove.is() )
{
xCertificateContainer->addCertificate( getHostName(), sServerCertificateSubject, sal_True );
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfTypes.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfTypes.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfTypes.hxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfTypes.hxx Wed Mar 19 10:14:42 2014
@@ -24,7 +24,7 @@
#ifndef INCLUDED_SERFTYPES_HXX
#define INCLUDED_SERFTYPES_HXX
-#include <serf.h>
+#include <serf/serf.h>
typedef serf_connection_t SerfConnection;
Modified: openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfUri.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfUri.hxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfUri.hxx (original)
+++ openoffice/branches/alg_writerframes/main/ucb/source/ucp/webdav/SerfUri.hxx Wed Mar 19 10:14:42 2014
@@ -23,7 +23,7 @@
#ifndef INCLUDED_SERFURI_HXX
#define INCLUDED_SERFURI_HXX
-#include <apr_uri.h>
+#include <apr-util/apr_uri.h>
#include <rtl/ustring.hxx>
#include "DAVException.hxx"
Modified: openoffice/branches/alg_writerframes/main/unoxml/source/dom/element.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/unoxml/source/dom/element.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/unoxml/source/dom/element.cxx (original)
+++ openoffice/branches/alg_writerframes/main/unoxml/source/dom/element.cxx Wed Mar 19 10:14:42 2014
@@ -630,7 +630,7 @@ namespace DOM
AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
::boost::shared_ptr<xmlChar const> const pOld(
xmlGetProp(m_aNodePtr, xName), xmlFree);
- if (pOld == NULL) {
+ if( !bool(pOld)) {
aChangeType = AttrChangeType_ADDITION;
xmlNewProp(m_aNodePtr, xName, xValue);
} else {
@@ -713,7 +713,7 @@ namespace DOM
AttrChangeType aChangeType = AttrChangeType_MODIFICATION;
::boost::shared_ptr<xmlChar const> const pOld(
xmlGetNsProp(m_aNodePtr, xLName, pNs->href), xmlFree);
- if (pOld == NULL) {
+ if( !bool(pOld)) {
aChangeType = AttrChangeType_ADDITION;
xmlNewNsProp(m_aNodePtr, pNs, xLName, xValue);
} else {
Modified: openoffice/branches/alg_writerframes/main/unoxml/source/xpath/nodelist.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/unoxml/source/xpath/nodelist.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/unoxml/source/xpath/nodelist.cxx (original)
+++ openoffice/branches/alg_writerframes/main/unoxml/source/xpath/nodelist.cxx Wed Mar 19 10:14:42 2014
@@ -35,7 +35,7 @@ namespace XPath
, m_rMutex(rMutex)
, m_pNodeSet(0)
{
- if (rxpathObj != NULL && rxpathObj->type == XPATH_NODESET)
+ if( bool(rxpathObj) && rxpathObj->type == XPATH_NODESET)
{
m_pNodeSet = rxpathObj->nodesetval;
m_pXPathObj = rxpathObj;
Modified: openoffice/branches/alg_writerframes/main/unoxml/source/xpath/xpathapi.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/unoxml/source/xpath/xpathapi.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/unoxml/source/xpath/xpathapi.cxx (original)
+++ openoffice/branches/alg_writerframes/main/unoxml/source/xpath/xpathapi.cxx Wed Mar 19 10:14:42 2014
@@ -378,7 +378,7 @@ namespace XPath
/* Create xpath evaluation context */
::boost::shared_ptr<xmlXPathContext> const xpathCtx(
xmlXPathNewContext(pDoc), xmlXPathFreeContext);
- if (xpathCtx == NULL) { throw XPathException(); }
+ if( !bool(xpathCtx)) { throw XPathException(); }
// set context node
xpathCtx->node = pNode;
Modified: openoffice/branches/alg_writerframes/main/uui/source/iahndl-ssl.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/uui/source/iahndl-ssl.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/uui/source/iahndl-ssl.cxx (original)
+++ openoffice/branches/alg_writerframes/main/uui/source/iahndl-ssl.cxx Wed Mar 19 10:14:42 2014
@@ -308,9 +308,10 @@ handleCertificateValidationRequest_(
certHostNames[0] = certHostName;
- for(int n = 1; n < altNames.getLength(); n++){
+ for(int n = 0; n < altNames.getLength(); ++n)
+ {
if (altNames[n].Type == security::ExtAltNameType_DNS_NAME){
- altNames[n].Value >>= certHostNames[n];
+ altNames[n].Value >>= certHostNames[n+1];
}
}
Modified: openoffice/branches/alg_writerframes/main/vcl/Library_vcl.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/Library_vcl.mk?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/Library_vcl.mk (original)
+++ openoffice/branches/alg_writerframes/main/vcl/Library_vcl.mk Wed Mar 19 10:14:42 2014
@@ -161,8 +161,8 @@ $(eval $(call gb_Library_add_exception_o
vcl/aqua/source/dtrans/PictToBmpFlt \
vcl/aqua/source/dtrans/aqua_clipboard \
vcl/aqua/source/dtrans/service_entry \
- vcl/aqua/source/gdi/atslayout \
- vcl/aqua/source/gdi/atsfonts \
+ vcl/aqua/source/gdi/ctfonts \
+ vcl/aqua/source/gdi/ctlayout \
vcl/aqua/source/gdi/salbmp \
vcl/aqua/source/gdi/salcolorutils \
vcl/aqua/source/gdi/salgdi \
@@ -512,11 +512,13 @@ $(eval $(call gb_Library_add_linked_libs
))
$(eval $(call gb_Library_set_ldflags,vcl,\
$$(LDFLAGS) \
- -framework QuickTime \
-framework Cocoa \
-framework Carbon \
-framework CoreFoundation \
))
+ifneq ($(MACOSX_DEPLOYMENT_TARGET),10.7)
+$(eval $(call gb_Library_set_ldflags,vcl, $$(LDFLAGS) -framework QuickTime ))
+endif
endif
ifeq ($(OS),WNT)
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapper.mm
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapper.mm?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapper.mm (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapper.mm Wed Mar 19 10:14:42 2014
@@ -380,8 +380,8 @@ static BOOL isPopupMenuOpen = NO;
[ aWrapper autorelease ];
}
// get associated NSWindow
- NSView * theView = [ aWrapper viewElementForParent ];
- return theView;
+ NSWindow* theWindow = [ aWrapper windowForParent ];
+ return theWindow;
}
-(id)topLevelUIElementAttribute {
@@ -1101,8 +1101,8 @@ Reference < XAccessibleContext > hitTest
return mpReferenceWrapper -> rAccessibleMultiLineText.get();
}
--(NSView *)viewElementForParent {
- return self;
+-(NSWindow*)windowForParent {
+ return [self window];
}
// These four are for AXTextAreas only. They are needed, because bold and italic
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapperrow.mm
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapperrow.mm?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapperrow.mm (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/a11y/aqua11ywrapperrow.mm Wed Mar 19 10:14:42 2014
@@ -34,7 +34,8 @@
@implementation AquaA11yWrapperRow : AquaA11yWrapper
-(id)disclosingAttribute {
- return NO; // TODO
+ // TODO: implement
+ return nil;
}
-(NSArray *)accessibilityAttributeNames {
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saldata.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saldata.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saldata.cxx (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saldata.cxx Wed Mar 19 10:14:42 2014
@@ -53,8 +53,8 @@ SalData::SalData()
mxP50Pattern( NULL ),
maCursors( POINTER_COUNT, INVALID_CURSOR_PTR ),
mbIsScrollbarDoubleMax( false ),
- mnSystemVersion( VER_TIGER ),
- mpMainController( NULL ),
+ mnSystemVersion( OSX_VER_LION ),
+ mpAppleRemoteMainController( NULL ),
mpDockIconClickHandler( nil ),
mnDPIX( 0 ),
mnDPIY( 0 )
@@ -89,8 +89,8 @@ SalData::~SalData()
osl_destroyThreadKey( s_aAutoReleaseKey );
s_aAutoReleaseKey = 0;
}
- if ( mpMainController )
- [mpMainController release];
+ if ( mpAppleRemoteMainController )
+ [mpAppleRemoteMainController release];
}
void SalData::ensureThreadAutoreleasePool()
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/salinst.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/salinst.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/salinst.cxx (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/salinst.cxx Wed Mar 19 10:14:42 2014
@@ -178,20 +178,19 @@ static void initNSApp()
object: nil ];
// get System Version and store the value in GetSalData()->mnSystemVersion
- OSErr err = noErr;
- SInt32 systemVersion = VER_TIGER; // Initialize with minimal requirement
- if( (err = Gestalt(gestaltSystemVersion, &systemVersion)) == noErr )
+ SInt32 systemVersion = OSX_VER_LION; // initialize with the minimal requirement
+ const OSErr err = Gestalt( gestaltSystemVersion, &systemVersion);
+ if( err == noErr )
{
GetSalData()->mnSystemVersion = systemVersion;
#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "System Version %x\n", (unsigned int)systemVersion);
+ fprintf( stderr, "OSX System Version 0x%04x\n", (unsigned int)systemVersion);
#endif
}
else
NSLog(@"Unable to obtain system version: %ld", (long)err);
- // Initialize Apple Remote
- GetSalData()->mpMainController = [[MainController alloc] init];
+ GetSalData()->mpAppleRemoteMainController = [[AppleRemoteMainController alloc] init];
[[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
selector: @selector(applicationWillBecomeActive:)
@@ -210,24 +209,10 @@ static void initNSApp()
sal_Bool ImplSVMainHook( sal_Bool * pbInit )
{
gpbInit = pbInit;
-
- bNoSVMain = false;
- initNSApp();
-
- NSPoint aPt = { 0, 0 };
- NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
- location: aPt
- modifierFlags: 0
- timestamp: 0
- windowNumber: 0
- context: nil
- subtype: AquaSalInstance::AppExecuteSVMain
- data1: 0
- data2: 0 ];
- if( pEvent )
- {
- [NSApp postEvent: pEvent atStart: NO];
-
+
+ bNoSVMain = false;
+ initNSApp();
+
rtl::OUString aExeURL, aExe;
osl_getExecutableFile( &aExeURL.pData );
osl_getSystemPathFromFileURL( aExeURL.pData, &aExe.pData );
@@ -241,11 +226,6 @@ sal_Bool ImplSVMainHook( sal_Bool * pbIn
const char* pArgv[] = { aByteExe.getStr(), NULL };
NSApplicationMain( 1, pArgv );
#endif
- }
- else
- {
- DBG_ERROR( "NSApplication initialization could not be done" );
- }
return TRUE; // indicate that ImplSVMainHook is implemented
}
@@ -496,9 +476,8 @@ void AquaSalInstance::wakeupYield()
if( mbWaitingYield )
{
SalData::ensureThreadAutoreleasePool();
- NSPoint aPt = { 0, 0 };
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
- location: aPt
+ location: NSZeroPoint
modifierFlags: 0
timestamp: 0
windowNumber: 0
@@ -620,11 +599,10 @@ void AquaSalInstance::handleAppDefinedEv
bool bIsFullScreenMode = false;
std::list<AquaSalFrame*>::iterator it = pSalData->maFrames.begin();
- while( (*it) && ( (it != pSalData->maFrames.end() ) || ( (*it)->mbFullScreen == false ) ) )
+ for(; it != pSalData->maFrames.end(); ++it )
{
- if ( ((*it)->mbFullScreen == true) )
+ if( (*it)->mbFullScreen )
bIsFullScreenMode = true;
- it++;
}
switch ([pEvent data1])
@@ -661,7 +639,7 @@ void AquaSalInstance::handleAppDefinedEv
break;
}
AquaSalFrame* pFrame = pSalData->maFrames.front();
- Window * pWindow = pFrame->GetWindow() ? pSalData->maFrames.front()->GetWindow() : NULL;
+ Window* pWindow = pFrame ? pFrame->GetWindow() : NULL;
if( pWindow )
{
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saltimer.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saltimer.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saltimer.cxx (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/saltimer.cxx Wed Mar 19 10:14:42 2014
@@ -71,9 +71,8 @@ void ImplSalStartTimer( sal_uLong nMS )
{
SalData::ensureThreadAutoreleasePool();
// post an event so we can get into the main thread
- NSPoint aPt = { 0, 0 };
NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
- location: aPt
+ location: NSZeroPoint
modifierFlags: 0
timestamp: [NSDate timeIntervalSinceReferenceDate]
windowNumber: 0
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/vclnsapp.mm
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/vclnsapp.mm?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/vclnsapp.mm (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/app/vclnsapp.mm Wed Mar 19 10:14:42 2014
@@ -54,6 +54,22 @@
@end
@implementation VCL_NSApplication
+
+-(void)applicationDidFinishLaunching:(NSNotification*)aNotification
+{
+ NSEvent* pEvent = [NSEvent otherEventWithType: NSApplicationDefined
+ location: NSZeroPoint
+ modifierFlags: 0
+ timestamp: 0
+ windowNumber: 0
+ context: nil
+ subtype: AquaSalInstance::AppExecuteSVMain
+ data1: 0
+ data2: 0 ];
+ if( pEvent )
+ [NSApp postEvent: pEvent atStart: NO];
+}
+
-(void)sendEvent:(NSEvent*)pEvent
{
NSEventType eType = [pEvent type];
@@ -79,7 +95,7 @@
if( nModMask == NSCommandKeyMask
&& [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] )
{
- [pFrame->getNSWindow() windowShouldClose: nil];
+ [(SalFrameWindow*)pFrame->getNSWindow() windowShouldClose: nil];
return;
}
}
@@ -182,7 +198,7 @@
}
}
}
- else if( eType == NSScrollWheel && ( GetSalData()->mnSystemVersion < VER_LEOPARD /* fixed in Leopard and above */ ) )
+ else if( eType == NSScrollWheel && ( GetSalData()->mnSystemVersion < OSX_VER_LEOPARD /* fixed in Leopard and above */ ) )
{
NSWindow* pWin = [pEvent window];
@@ -450,15 +466,16 @@
{
(void)pNotification;
SalData* pSalData = GetSalData();
- if( pSalData->mpMainController && pSalData->mpMainController->remoteControl)
+ AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
+ if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
{
// [remoteControl startListening: self];
// does crash because the right thing to do is
- // [GetSalData()->mpMainController->remoteControl startListening: self];
+ // [pAppleRemoteCtrl->remoteControl startListening: self];
// but the instance variable 'remoteControl' is declared protected
// workaround : declare remoteControl instance variable as public in RemoteMainController.m
- [pSalData->mpMainController->remoteControl startListening: self];
+ [pAppleRemoteCtrl->remoteControl startListening: self];
#ifdef DEBUG
NSLog(@"Apple Remote will become active - Using remote controls");
#endif
@@ -477,15 +494,16 @@
{
(void)pNotification;
SalData* pSalData = GetSalData();
- if( pSalData->mpMainController && pSalData->mpMainController->remoteControl)
+ AppleRemoteMainController* pAppleRemoteCtrl = pSalData->mpAppleRemoteMainController;
+ if( pAppleRemoteCtrl && pAppleRemoteCtrl->remoteControl)
{
// [remoteControl stopListening: self];
// does crash because the right thing to do is
- // [GetSalData()->mpMainController->remoteControl stopListening: self];
+ // [pAppleRemoteCtrl->remoteControl stopListening: self];
// but the instance variable 'remoteControl' is declared protected
// workaround : declare remoteControl instance variable as public in RemoteMainController.m
- [pSalData->mpMainController->remoteControl stopListening: self];
+ [pAppleRemoteCtrl->remoteControl stopListening: self];
#ifdef DEBUG
NSLog(@"Apple Remote will resign active - Releasing remote controls");
#endif
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DataFlavorMapping.cxx Wed Mar 19 10:14:42 2014
@@ -608,7 +608,13 @@ DataProviderPtr_t DataFlavorMapper::getD
}
else
*/
- if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
+#ifdef MAC_OS_X_VERSION_10_6
+ if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypePNG] == NSOrderedSame)
+ {
+ dp = DataProviderPtr_t( new PNGDataProvider( data, NSPNGFileType));
+ } else
+#endif // MAC_OS_X_VERSION_10_5
+ if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t( new PNGDataProvider( data, PICTImageFileType));
}
@@ -657,6 +663,12 @@ DataProviderPtr_t DataFlavorMapper::getD
{
dp = DataProviderPtr_t(new HTMLFormatDataProvider(systemData));
}
+#ifdef MAC_OS_X_VERSION_10_6
+ else if ([systemFlavor caseInsensitiveCompare: NSPasteboardTypePNG] == NSOrderedSame)
+ {
+ dp = DataProviderPtr_t( new PNGDataProvider(systemData, NSPNGFileType));
+ }
+#endif // MAC_OS_X_VERSION_10_6
else if ([systemFlavor caseInsensitiveCompare: NSPICTPboardType] == NSOrderedSame)
{
dp = DataProviderPtr_t( new PNGDataProvider(systemData, PICTImageFileType));
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DropTarget.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DropTarget.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DropTarget.cxx (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/DropTarget.cxx Wed Mar 19 10:14:42 2014
@@ -299,15 +299,12 @@ NSDragOperation DropTarget::draggingUpda
//NSLog(@"Drag update: Source actions: %x proposed action %x selected action %x", mDragSourceSupportedActions, currentAction, mSelectedDropAction);
}
- // Weird but it appears as if there is no method in Cocoa
- // to create a kThemeCopyArrowCursor hence we have to use
- // Carbon to do it
if (dragOp == NSDragOperationNone)
- SetThemeCursor(kThemeNotAllowedCursor);
+ [[NSCursor operationNotAllowedCursor] set];
else if (dragOp == NSDragOperationCopy)
- SetThemeCursor(kThemeCopyArrowCursor);
+ [[NSCursor dragCopyCursor] set];
else
- SetThemeCursor(kThemeArrowCursor);
+ [[NSCursor arrowCursor] set];
return dragOp;
}
@@ -319,7 +316,7 @@ void DropTarget::draggingExited(id /*sen
fire_dragExit(dte);
mDragSourceSupportedActions = DNDConstants::ACTION_NONE;
mSelectedDropAction = DNDConstants::ACTION_NONE;
- SetThemeCursor(kThemeArrowCursor);
+ [[NSCursor arrowCursor] set];
}
@@ -373,7 +370,7 @@ void DropTarget::concludeDragOperation(i
mDragSourceSupportedActions = DNDConstants::ACTION_NONE;
mSelectedDropAction = DNDConstants::ACTION_NONE;
mXCurrentDragClipboard = uno::Reference<XClipboard>();
- SetThemeCursor(kThemeArrowCursor);
+ [[NSCursor arrowCursor] set];
}
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/dtrans/PictToBmpFlt.cxx Wed Mar 19 10:14:42 2014
@@ -39,6 +39,9 @@
bool PICTtoPNG( com::sun::star::uno::Sequence<sal_Int8>& rPictData,
com::sun::star::uno::Sequence<sal_Int8>& rPngData)
{
+#ifdef MAC_OS_X_VERSION_10_6
+ return false;
+#else // MAC_OS_X_VERSION_10_6
ComponentInstance pngExporter = NULL;
if( OpenADefaultComponent( GraphicsExporterComponentType, kQTFileTypePNG, &pngExporter) != noErr)
return false;
@@ -72,12 +75,16 @@ bool PICTtoPNG( com::sun::star::uno::Seq
CloseComponent( pngExporter);
return (nPngSize > 0);
+#endif // MAC_OS_X_VERSION_10_6
}
bool PNGtoPICT( com::sun::star::uno::Sequence<sal_Int8>& rPngData,
com::sun::star::uno::Sequence<sal_Int8>& rPictData)
{
+#ifdef MAC_OS_X_VERSION_10_6
+ return false;
+#else // MAC_OS_X_VERSION_10_6
ComponentInstance pictExporter;
if( OpenADefaultComponent( GraphicsImporterComponentType, kQTFileTypePNG, &pictExporter) != noErr)
return false;
@@ -99,9 +106,11 @@ bool PNGtoPICT( com::sun::star::uno::Seq
rtl_copyMemory( rPictData.getArray(), ((sal_Int8*)*hPict), nPictSize);
HUnlock( (Handle)hPict);
+#if __MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
// Release the data associated with the picture
- // Note: This function is deprecated in Mac OSX 10.4
+ // Note: This function has been deprecated in OSX 10.4 and removed in OSX 10.7
KillPicture( hPict);
+#endif
}
if( hPng)
@@ -110,15 +119,24 @@ bool PNGtoPICT( com::sun::star::uno::Seq
CloseComponent( pictExporter);
return (nPictSize > 512);
+#endif // MAC_OS_X_VERSION_10_6
}
bool ImageToPNG( com::sun::star::uno::Sequence<sal_Int8>& rImgData,
com::sun::star::uno::Sequence<sal_Int8>& rPngData,
NSBitmapImageFileType eInFormat)
{
+ // short circuit for PNG->PNG request
+ if( eInFormat == NSPNGFileType) {
+ rPngData = rImgData;
+ return true;
+ }
+
+ // special handling for old PICT images that are not supported by NSBitmapImage
if( eInFormat == PICTImageFileType)
return PICTtoPNG( rImgData, rPngData);
+ // let Cocoa's NSBitmapImageRep do the conversion
NSData* pData = [NSData dataWithBytesNoCopy: (void*)rImgData.getConstArray() length: rImgData.getLength() freeWhenDone: 0];
if( !pData)
return false;
@@ -131,6 +149,7 @@ bool ImageToPNG( com::sun::star::uno::Se
if( !pOut)
return false;
+ // get the conversion result
const size_t nPngSize = [pOut length];
rPngData.realloc( nPngSize);
[pOut getBytes: rPngData.getArray() length: nPngSize];
@@ -142,9 +161,17 @@ bool PNGToImage( com::sun::star::uno::Se
NSBitmapImageFileType eOutFormat
)
{
+ // short circuit for PNG->PNG request
+ if( eOutFormat == NSPNGFileType) {
+ rImgData = rPngData;
+ return true;
+ }
+
+ // special handling for old PICT images that are not supported by NSBitmapImage
if( eOutFormat == PICTImageFileType)
return PNGtoPICT( rPngData, rImgData);
-
+
+ // let Cocoa's NSBitmapImageRep do the conversion
NSData* pData = [NSData dataWithBytesNoCopy: const_cast<sal_Int8*>(rPngData.getConstArray()) length: rPngData.getLength() freeWhenDone: 0];
if( !pData)
return false;
@@ -157,6 +184,7 @@ bool PNGToImage( com::sun::star::uno::Se
if( !pOut)
return false;
+ // get the conversion result
const size_t nImgSize = [pOut length];
rImgData.realloc( nImgSize);
[pOut getBytes: rImgData.getArray() length: nImgSize];
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintaccessoryview.mm?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintaccessoryview.mm (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintaccessoryview.mm Wed Mar 19 10:14:42 2014
@@ -643,7 +643,7 @@ static void adjustViewAndChildren( NSVie
NSArray* pSubViews = [pNSView subviews];
unsigned int nViews = [pSubViews count];
- NSRect aUnion = { { 0, 0 }, { 0, 0 } };
+ NSRect aUnion = NSZeroRect;
// get the combined frame of all subviews
for( unsigned int n = 0; n < nViews; n++ )
@@ -712,7 +712,7 @@ static void adjustTabViews( NSTabView* p
static NSControl* createLabel( const rtl::OUString& i_rText )
{
NSString* pText = CreateNSString( i_rText );
- NSRect aTextRect = { { 0, 0 }, {20, 15} };
+ NSRect aTextRect = { NSZeroPoint, {20, 15} };
NSTextField* pTextView = [[NSTextField alloc] initWithFrame: aTextRect];
[pTextView setFont: [NSFont controlContentFontOfSize: 0]];
[pTextView setEditable: NO];
@@ -1093,9 +1093,9 @@ static void addEdit( NSView* pCurParent,
NSView* pCurParent = 0;
long nCurY = 0;
long nCurX = 0;
- NSRect aViewFrame = { { 0, 0 }, {600, 400 } };
+ NSRect aViewFrame = { NSZeroPoint, {600, 400 } };
NSRect aTabViewFrame = { { 190, 0 }, {410, 400 } };
- NSSize aMaxTabSize = { 0, 0 };
+ NSSize aMaxTabSize = NSZeroSize;
NSView* pAccessoryView = [[NSView alloc] initWithFrame: aViewFrame];
NSTabView* pTabView = [[NSTabView alloc] initWithFrame: aTabViewFrame];
[pAccessoryView addSubview: [pTabView autorelease]];
Modified: openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintview.mm
URL: http://svn.apache.org/viewvc/openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintview.mm?rev=1579184&r1=1579183&r2=1579184&view=diff
==============================================================================
--- openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintview.mm (original)
+++ openoffice/branches/alg_writerframes/main/vcl/aqua/source/gdi/aquaprintview.mm Wed Mar 19 10:14:42 2014
@@ -32,7 +32,7 @@
@implementation AquaPrintView
-(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter
{
- NSRect aRect = { { 0, 0 }, [pInfoPrinter->getPrintInfo() paperSize] };
+ NSRect aRect = { NSZeroPoint, [pInfoPrinter->getPrintInfo() paperSize] };
if( (self = [super initWithFrame: aRect]) != nil )
{
mpController = pController;
@@ -62,8 +62,7 @@
-(NSPoint)locationOfPrintRect: (NSRect)aRect
{
(void)aRect;
- NSPoint aPoint = { 0, 0 };
- return aPoint;
+ return NSZeroPoint;
}
-(void)drawRect: (NSRect)rect