summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-01-05 14:46:45 +0100
committerMathias Bauer <mba@openoffice.org>2010-01-05 14:46:45 +0100
commitebbf721d69d4040a392d493c8a89a4c0023476cf (patch)
tree9ff4a8547c8ee1cc93878e2bcc79f53630d477a1
parent3fa259739300c572830e3680de6fcf93257fca4c (diff)
parent3439c301e10bf14bdc7d1494ea0a4b5f170627bb (diff)
merge commit for m68
-rw-r--r--sw/inc/hints.hxx19
-rw-r--r--sw/inc/shellres.hxx2
-rw-r--r--sw/source/core/attr/hints.cxx12
-rw-r--r--sw/source/core/doc/docnew.cxx3
-rw-r--r--sw/source/core/docnode/node.cxx13
-rw-r--r--sw/source/core/fields/docufld.cxx70
-rw-r--r--sw/source/core/text/txtfrm.cxx11
-rw-r--r--sw/source/core/txtnode/txtedt.cxx1
-rw-r--r--sw/source/core/unocore/unomap.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx31
-rw-r--r--sw/source/core/view/vprint.cxx59
-rw-r--r--sw/source/ui/app/docsh2.cxx2
-rw-r--r--sw/source/ui/dbui/maildispatcher.cxx11
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx6
-rw-r--r--sw/source/ui/fldui/flddinf.cxx80
-rw-r--r--sw/source/ui/fldui/flddinf.hxx7
-rw-r--r--sw/source/ui/fldui/fldedt.cxx18
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx34
-rw-r--r--sw/source/ui/fldui/makefile.mk1
-rw-r--r--sw/source/ui/inc/maildispatcher.hxx2
-rw-r--r--sw/source/ui/table/convert.src2
-rw-r--r--sw/source/ui/table/instable.src2
-rw-r--r--sw/source/ui/uiview/viewprt.cxx3
-rw-r--r--sw/source/ui/utlui/initui.cxx1
-rw-r--r--sw/source/ui/utlui/initui.hrc1
-rw-r--r--sw/source/ui/utlui/initui.src4
26 files changed, 226 insertions, 171 deletions
diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx
index 83c3b114acc6..16f8568bcf74 100644
--- a/sw/inc/hints.hxx
+++ b/sw/inc/hints.hxx
@@ -88,14 +88,6 @@ public:
};
-class SwInsChr: public SwMsgPoolItem
-{
-public:
- xub_StrLen nPos;
-
- SwInsChr( USHORT nP );
-};
-
class SwInsTxt: public SwMsgPoolItem
{
public:
@@ -270,17 +262,6 @@ public:
//};
// <--
-class SwNRuleLowerLevel : public SwMsgPoolItem
-{
- const String& rName;
- BYTE nLvl;
-public:
- SwNRuleLowerLevel( const String& rRuleName, BYTE nLevel );
-
- const String& GetName() const { return rName; }
- BYTE GetLevel() const { return nLvl; }
-};
-
class SwFindNearestNode : public SwMsgPoolItem
{
const SwNode *pNd, *pFnd;
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index 8ee5d0c3e991..8c677c9ed8db 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -72,6 +72,8 @@ struct SW_DLLPUBLIC ShellResource : public Resource
String aStrNone;
// fuer Felder, die Fixiert sind
String aFixedStr;
+ // custom fields of type css::util::Duration
+ String sDurationFormat;
//names of TOXs
String aTOXIndexName;
diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx
index d77e5bb9c4ff..8d71c70cf58f 100644
--- a/sw/source/core/attr/hints.cxx
+++ b/sw/source/core/attr/hints.cxx
@@ -47,12 +47,6 @@ SwFmtChg::SwFmtChg( SwFmt *pFmt )
{}
-SwInsChr::SwInsChr( xub_StrLen nP )
- : SwMsgPoolItem( RES_INS_CHR ),
- nPos( nP )
-{}
-
-
SwInsTxt::SwInsTxt( xub_StrLen nP, xub_StrLen nL )
: SwMsgPoolItem( RES_INS_TXT ),
@@ -227,12 +221,6 @@ SwVirtPageNumInfo::SwVirtPageNumInfo( const SwPageFrm *pPg ) :
// aList.Insert(rNd.GetIndex(), &rNd);
//}
-SwNRuleLowerLevel::SwNRuleLowerLevel( const String& rRuleName, BYTE nSrchLvl )
- : SwMsgPoolItem( RES_GETLOWERNUMLEVEL ), rName( rRuleName ),
- nLvl(nSrchLvl)
-{
-}
-
SwFindNearestNode::SwFindNearestNode( const SwNode& rNd )
: SwMsgPoolItem( RES_FINDNEARESTNODE ), pNd( &rNd ), pFnd( 0 )
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index a440ab23f1e4..57d017bd050e 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1353,6 +1353,7 @@ SwDoc* SwDoc::CreateCopy() const
ResetModified();
*/
+ pRet->ReplaceStyles( *(SwDoc*)this );
//copy content
pRet->Paste( *this );
return pRet;
@@ -1417,7 +1418,7 @@ void SwDoc::Paste( const SwDoc& rSource )
SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
if( FLY_PAGE == aAnchor.GetAnchorId() )
{
- aAnchor.SetPageNum( aAnchor.GetPageNum() + /*nStartPageNumber - */1 );
+ aAnchor.SetPageNum( aAnchor.GetPageNum() /*+ nStartPageNumber - */);
}
else
continue;
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 9c428b3b6b29..3318b2575230 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1479,7 +1479,6 @@ SwCntntNode *SwCntntNode::JoinPrev()
// erfrage vom Modify Informationen
BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
{
- const SwNumRuleItem* pItem;
switch( rInfo.Which() )
{
case RES_AUTOFMT_DOCNODE:
@@ -1509,18 +1508,6 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const
// return TRUE;
// <--
- case RES_GETLOWERNUMLEVEL:
- if( IsTxtNode() &&
- 0 != ( pItem = (SwNumRuleItem*)GetNoCondAttr(
- RES_PARATR_NUMRULE, TRUE )) && pItem->GetValue().Len() &&
- pItem->GetValue() == ((SwNRuleLowerLevel&)rInfo).GetName() &&
- ((SwTxtNode*)this)->GetActualListLevel()
- > ((SwNRuleLowerLevel&)rInfo).GetLevel() )
- {
- return FALSE;
- }
- break;
-
case RES_FINDNEARESTNODE:
if( ((SwFmtPageDesc&)GetAttr( RES_PAGEDESC )).GetPageDesc() )
((SwFindNearestNode&)rInfo).CheckNode( *this );
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index c049a50b3940..c4241a33c798 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -47,31 +47,32 @@
#include <com/sun/star/text/UserFieldFormat.hpp>
#include <com/sun/star/text/PageNumberType.hpp>
#include <com/sun/star/text/ReferenceFieldPart.hpp>
-#ifndef _COM_SUN_STAR_TEXT_FilenameDisplayFormat_HPP_
#include <com/sun/star/text/FilenameDisplayFormat.hpp>
-#endif
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/DocumentStatistic.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/Duration.hpp>
#include <unotools/localedatawrapper.hxx>
#include <svx/unolingu.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <comphelper/string.hxx>
#include <tools/urlobj.hxx>
-#ifndef _APP_HXX //autogen
#include <vcl/svapp.hxx>
-#endif
#include <svl/urihelper.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/syslocale.hxx>
+#include <svl/zforlist.hxx>
#include <tools/time.hxx>
#include <tools/datetime.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/Time.hpp>
#include <tools/shl.hxx>
#include <swmodule.hxx>
@@ -90,9 +91,7 @@
#include <cntfrm.hxx> //
#include <pam.hxx>
#include <viewsh.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <shellres.hxx>
#include <docufld.hxx>
#include <flddat.hxx>
@@ -100,16 +99,10 @@
#include <ndtxt.hxx>
#include <expfld.hxx>
#include <poolfmt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef _UNOFLDMID_H
#include <unofldmid.h>
-#endif
#include <swunohelper.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <svx/outliner.hxx>
#include <svx/outlobj.hxx>
@@ -1114,6 +1107,21 @@ SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
+template<class T>
+double lcl_TimeToDouble( const T& rTime )
+{
+ const double fMilliSecondsPerDay = 86400000.0;
+ return ((rTime.Hours*3600000)+(rTime.Minutes*60000)+(rTime.Seconds*1000)+(rTime.HundredthSeconds*10)) / fMilliSecondsPerDay;
+}
+
+template<class D>
+double lcl_DateToDouble( const D& rDate, const Date& rNullDate )
+{
+ long nDate = Date::DateToDays( rDate.Day, rDate.Month, rDate.Year );
+ long nNullDate = Date::DateToDays( rNullDate.GetDay(), rNullDate.GetMonth(), rNullDate.GetYear() );
+ return double( nDate - nNullDate );
+}
+
String SwDocInfoField::Expand() const
{
if ( ( nSubType & 0xFF ) == DI_CUSTOM )
@@ -1145,9 +1153,41 @@ String SwDocInfoField::Expand() const
::rtl::OUString sVal;
uno::Reference < script::XTypeConverter > xConverter( comphelper::getProcessServiceFactory()
->createInstance(::rtl::OUString::createFromAscii("com.sun.star.script.Converter")), uno::UNO_QUERY );
- uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
- aNew >>= sVal;
- const_cast<SwDocInfoField*>(this)->aContent = sVal;
+ util::Date aDate;
+ util::DateTime aDateTime;
+ util::Duration aDuration;
+ if( aAny >>= aDate)
+ {
+ SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
+ Date* pNullDate = pFormatter->GetNullDate();
+ sVal = ExpandValue( lcl_DateToDouble<util::Date>( aDate, *pNullDate ), GetFormat(), GetLanguage());
+ }
+ else if( aAny >>= aDateTime )
+ {
+ double fDateTime = lcl_TimeToDouble<util::DateTime>( aDateTime );
+ SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
+ Date* pNullDate = pFormatter->GetNullDate();
+ fDateTime += lcl_DateToDouble<util::DateTime>( aDateTime, *pNullDate );
+ sVal = ExpandValue( fDateTime, GetFormat(), GetLanguage());
+ }
+ else if( aAny >>= aDuration )
+ {
+ String sText(aDuration.Negative ? '-' : '+');
+ sText += ViewShell::GetShellRes()->sDurationFormat;
+ sText.SearchAndReplace(String::CreateFromAscii( "%1"), String::CreateFromInt32( aDuration.Years ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%2"), String::CreateFromInt32( aDuration.Months ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%3"), String::CreateFromInt32( aDuration.Days ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%4"), String::CreateFromInt32( aDuration.Hours ) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%5"), String::CreateFromInt32( aDuration.Minutes) );
+ sText.SearchAndReplace(String::CreateFromAscii( "%6"), String::CreateFromInt32( aDuration.Seconds) );
+ sVal = sText;
+ }
+ else
+ {
+ uno::Any aNew = xConverter->convertToSimpleType( aAny, uno::TypeClass_STRING );
+ aNew >>= sVal;
+ }
+ ((SwDocInfoField*)this)->aContent = sVal;
}
}
}
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 698a52bdd826..7df571159c38 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -940,17 +940,6 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
InvalidateLineNum();
}
break;
- case RES_INS_CHR:
- {
- nPos = ((SwInsChr*)pNew)->nPos;
- InvalidateRange( SwCharRange( nPos, 1 ), 1 );
- SET_WRONG( nPos, 1, true )
- SET_SCRIPT_INVAL( nPos )
- bSetFldsDirty = sal_True;
- if( HasFollow() )
- lcl_ModifyOfst( this, nPos, 1 );
- }
- break;
case RES_INS_TXT:
{
nPos = ((SwInsTxt*)pNew)->nPos;
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 7a33a256a0a1..1b931ad68fd5 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -368,7 +368,6 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
return bRet;
}
-
inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
return ((nIdx >=nStart) && (nIdx <= nEnd));
}
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index f2f48e382508..1ce2d6bc3792 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -2250,6 +2250,8 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
{SW_PROP_NMID(UNO_NAME_NAME), FIELD_PROP_PAR4, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_CURRENT_PRESENTATION), FIELD_PROP_PAR3, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, 0},
{SW_PROP_NMID(UNO_NAME_IS_FIXED), FIELD_PROP_BOOL1, CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE,0},
+ {SW_PROP_NMID(UNO_NAME_NUMBER_FORMAT), FIELD_PROP_FORMAT, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, 0},
+ {SW_PROP_NMID(UNO_NAME_IS_FIXED_LANGUAGE), FIELD_PROP_BOOL4, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0},
COMMON_FLDTYP_PROPERTIES
{0,0,0,0,0,0}
};
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index fb7c08a61f19..cd80439877f6 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -376,6 +376,37 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
// #i75172# end DrawingLayer paint
DLPostPaint2(true);
}
+
+ // --> OD 2009-12-03 #i107365#
+ // Direct paint has been performed. Thus, take care of
+ // transparent child windows.
+ if ( GetWin() )
+ {
+ Window& rWindow = *(GetWin());
+ if(rWindow.IsChildTransparentModeEnabled() && rWindow.GetChildCount())
+ {
+ const Rectangle aRectanglePixel(rWindow.LogicToPixel(aRect.SVRect()));
+
+ for ( sal_uInt16 a(0); a < rWindow.GetChildCount(); a++ )
+ {
+ Window* pCandidate = rWindow.GetChild(a);
+
+ if ( pCandidate && pCandidate->IsPaintTransparent() )
+ {
+ const Rectangle aCandidatePosSizePixel(
+ pCandidate->GetPosPixel(),
+ pCandidate->GetSizePixel());
+
+ if ( aCandidatePosSizePixel.IsOver(aRectanglePixel) )
+ {
+ pCandidate->Invalidate( INVALIDATE_NOTRANSPARENT|INVALIDATE_CHILDREN );
+ pCandidate->Update();
+ }
+ }
+ }
+ }
+ }
+ // <--
}
delete pVout;
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index d16356e20ed3..e64a3f58eba2 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -776,16 +776,32 @@ SwDoc * ViewShell::CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef &rDocShellR
pActCrsr = dynamic_cast<SwShellCrsr*>(pActCrsr->GetPrev());
}
- // Die Y-Position der ersten Selektion
- const Point aSelPoint = pFESh->IsTableMode() ?
- pFESh->GetTableCrsr()->GetSttPos() :
- pFirstCrsr->GetSttPos();
+ Point aSelPoint;
+ if( pFESh->IsTableMode() )
+ {
+ SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr();
+
+ const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode();
+ const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0;
+ if( pCntntFrm )
+ {
+ SwRect aCharRect;
+ SwCrsrMoveState aTmpState( MV_NONE );
+ pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState );
+ aSelPoint = Point( aCharRect.Left(), aCharRect.Top() );
+ }
+ }
+ else
+ {
+ aSelPoint = pFirstCrsr->GetSttPos();
+ }
const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint );
+ ASSERT( pPage, "no page found!" );
- // und ihren Seitendescribtor
- const SwPageDesc* pPageDesc = pPrtDoc->FindPageDescByName(
- pPage->GetPageDesc()->GetName() );
+ // get page descriptor - fall back to the first one if pPage could not be found
+ const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName(
+ pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 );
if( !pFESh->IsTableMode() && pActCrsr->HasMark() )
{ // Am letzten Absatz die Absatzattribute richten:
@@ -868,15 +884,32 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
// Die Y-Position der ersten Selektion
// Die Y-Position der ersten Selektion
- const Point aSelPoint = pFESh->IsTableMode() ?
- pFESh->GetTableCrsr()->GetSttPos() :
- pFirstCrsr->GetSttPos();
+ Point aSelPoint;
+ if( pFESh->IsTableMode() )
+ {
+ SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr();
+
+ const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode();
+ const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0;
+ if( pCntntFrm )
+ {
+ SwRect aCharRect;
+ SwCrsrMoveState aTmpState( MV_NONE );
+ pCntntFrm->GetCharRect( aCharRect, *pShellTblCrsr->Start(), &aTmpState );
+ aSelPoint = Point( aCharRect.Left(), aCharRect.Top() );
+ }
+ }
+ else
+ {
+ aSelPoint = pFirstCrsr->GetSttPos();
+ }
const SwPageFrm* pPage = GetLayout()->GetPageAtPos( aSelPoint );
+ ASSERT( pPage, "no page found!" );
- // und ihren Seitendescribtor
- const SwPageDesc* pPageDesc = pPrtDoc->FindPageDescByName(
- pPage->GetPageDesc()->GetName() );
+ // get page descriptor - fall back to the first one if pPage could not be found
+ const SwPageDesc* pPageDesc = pPage ? pPrtDoc->FindPageDescByName(
+ pPage->GetPageDesc()->GetName() ) : &pPrtDoc->_GetPageDesc( (sal_uInt16)0 );
if( !pFESh->IsTableMode() && pActCrsr->HasMark() )
{ // Am letzten Absatz die Absatzattribute richten:
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index a5b6414ae3a6..84c2ae9b9a95 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -180,8 +180,6 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet &rSet)
{
SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog(pParent, rSet);
-// const SfxDocumentInfoItem& rItem = (const SfxDocumentInfoItem&)rSet.Get(SID_DOCINFO);
-// if(rItem.IsOwnFormat())
//nur mit Statistik, wenn dieses Doc auch angezeigt wird, nicht
//aus dem Doc-Manager
SwDocShell* pDocSh = (SwDocShell*) SfxObjectShell::Current();
diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx
index e49c5c68fccb..81dabd052042 100644
--- a/sw/source/ui/dbui/maildispatcher.cxx
+++ b/sw/source/ui/dbui/maildispatcher.cxx
@@ -110,8 +110,7 @@ namespace /* private */
MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) :
mailserver_ (mailserver),
run_(false),
- shutdown_requested_(false),
- bIsInRun(false)
+ shutdown_requested_(false)
{
wakening_call_.reset();
mail_dispatcher_active_.reset();
@@ -206,12 +205,6 @@ bool MailDispatcher::isStarted() const
return run_;
}
-bool MailDispatcher::isRunning() const
-{
- return bIsInRun;
-}
-
-
void MailDispatcher::addListener(::rtl::Reference<IMailDispatcherListener> listener)
{
OSL_PRECOND(!shutdown_requested_, "MailDispatcher thread is shuting down already");
@@ -267,7 +260,6 @@ void MailDispatcher::run()
// signal that the mail dispatcher thread is now alive
mail_dispatcher_active_.set();
- bIsInRun = true;
for(;;)
{
wakening_call_.wait();
@@ -295,7 +287,6 @@ void MailDispatcher::run()
std::for_each(listeners_cloned.begin(), listeners_cloned.end(), GenericEventNotifier(&IMailDispatcherListener::idle, this));
}
} // end for SSH ALI
- bIsInRun = false;
}
/*-- 27.08.2004 12:04:46---------------------------------------------------
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index ed33546e6028..2a37f6911b02 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1480,14 +1480,16 @@ static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox )
uno::Reference < embed::XStorage > xStg;
if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() )
{
- SvStringsDtor aArr( 10, 10 );
+ SvStrings aArr( 10, 10 );
sal_uInt32 nFormat = SotStorage::GetFormatID( xStg );
if ( nFormat == SOT_FORMATSTR_ID_STARWRITER_60 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_60 ||
nFormat == SOT_FORMATSTR_ID_STARWRITER_8 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_8)
- SwGetReaderXML()->GetSectionList( rMedium, (SvStrings&) aArr );
+ SwGetReaderXML()->GetSectionList( rMedium, aArr );
for( USHORT n = 0; n < aArr.Count(); ++n )
rBox.InsertEntry( *aArr[ n ] );
+
+ aArr.DeleteAndDestroy(0, aArr.Count());
}
}
/* -----------------21.05.99 10:16-------------------
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 7859b51c10f4..4bdb5dc005db 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -39,14 +39,11 @@
#include <sfx2/frame.hxx>
#include <vcl/svapp.hxx>
#include <svl/zforlist.hxx>
+#include <svl/zformat.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
#include <swtypes.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <fldbas.hxx>
#include <docufld.hxx>
#include <wrtsh.hxx>
@@ -63,13 +60,16 @@
#ifndef _VIEW_HXX
#include <view.hxx>
#endif
-#include <svl/zformat.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/util/Time.hpp>
+#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/util/Date.hpp>
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
using namespace nsSwDocInfoSubType;
-
+using namespace com::sun::star;
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -103,7 +103,7 @@ SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
SFX_ITEMSET_ARG( &rCoreSet, pItem, SfxUnoAnyItem, SID_DOCINFO, FALSE );
if ( pItem )
- pItem->GetValue() >>= aPropertyNames;
+ pItem->GetValue() >>= xCustomPropertySet;
}
/*--------------------------------------------------------------------
@@ -168,24 +168,31 @@ void __EXPORT SwFldDokInfPage::Reset(const SfxItemSet& )
{
if (DI_CUSTOM == i)
{
- if (aPropertyNames.getLength() )
+ if(xCustomPropertySet.is() )
{
+ uno::Reference< beans::XPropertySetInfo > xSetInfo = xCustomPropertySet->getPropertySetInfo();
+ const uno::Sequence< beans::Property > rProperties = xSetInfo->getProperties();
+// uno::Sequence< ::rtl::OUString > aPropertyNames(rProperties.getLength());
+// for (sal_Int32 i = 0; i < rProperties.getLength(); ++i) {
+// aPropertyNames[i] = rProperties[i].Name;
+// }
//if ( !IsFldEdit() )
+ if( rProperties.getLength() )
{
pInfo = aTypeTLB.InsertEntry( String(SW_RES( STR_CUSTOM )) );
pInfo->SetUserData(reinterpret_cast<void*>(USHRT_MAX));
- }
- for (sal_Int32 n=0; n<aPropertyNames.getLength(); n++)
- {
- rtl::OUString sEntry = aPropertyNames[n];
- pEntry = aTypeTLB.InsertEntry(sEntry, pInfo);
- if(m_sOldCustomFieldName.equals( sEntry ))
+ for (sal_Int32 n=0; n < rProperties.getLength(); n++)
{
- pSelEntry = pEntry;
- aTypeTLB.Expand( pInfo );
+ rtl::OUString sEntry = rProperties[n].Name;
+ pEntry = aTypeTLB.InsertEntry(sEntry, pInfo);
+ if(m_sOldCustomFieldName.equals( sEntry ))
+ {
+ pSelEntry = pEntry;
+ aTypeTLB.Expand( pInfo );
+ }
+ pEntry->SetUserData(reinterpret_cast<void*>(i));
}
- pEntry->SetUserData(reinterpret_cast<void*>(i));
}
}
}
@@ -263,12 +270,12 @@ IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG )
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
-
IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
{
USHORT nSubType = (USHORT)(ULONG)pSelEntry->GetUserData();
USHORT nPos = aSelectionLB.GetSelectEntryPos();
USHORT nExtSubType;
+ USHORT nNewType = 0;
if (nSubType != DI_EDIT)
{
@@ -279,7 +286,33 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
aFormatLB.Clear();
aFormatLB.Enable(FALSE);
aFormatFT.Enable(FALSE);
- return 0;
+ if( nSubType == DI_CUSTOM )
+ {
+ //find out which type the custom field has - for a start set to DATE format
+ ::rtl::OUString sName = aTypeTLB.GetEntryText(pSelEntry);
+ try
+ {
+ uno::Any aVal = xCustomPropertySet->getPropertyValue( sName );
+ const uno::Type& rValueType = aVal.getValueType();
+ if( rValueType == ::getCppuType( (util::DateTime*)0 ))
+ {
+ nNewType = NUMBERFORMAT_DATETIME;
+ }
+ else if( rValueType == ::getCppuType( (util::Date*)0 ))
+ {
+ nNewType = NUMBERFORMAT_DATE;
+ }
+ else if( rValueType == ::getCppuType( (util::Time*)0 ))
+ {
+ nNewType = NUMBERFORMAT_TIME;
+ }
+ }
+ catch( const uno::Exception& )
+ {
+ }
+ }
+ else
+ return 0;
}
nPos = 0;
}
@@ -290,7 +323,6 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
nExtSubType = DI_SUB_TIME;
USHORT nOldType = 0;
- USHORT nNewType = 0;
BOOL bEnable = FALSE;
BOOL bOneArea = FALSE;
@@ -312,7 +344,6 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
bOneArea = TRUE;
break;
}
-
if (!nNewType)
{
aFormatLB.Clear();
@@ -334,7 +365,7 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
if (IsFldEdit())
{
nPos = aSelectionLB.GetSelectEntryPos();
- if (nPos != LISTBOX_ENTRY_NOTFOUND)
+ if (nPos != LISTBOX_ENTRY_NOTFOUND )
{
nSubType = (USHORT)(ULONG)aSelectionLB.GetEntryData(nPos);
@@ -346,7 +377,6 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
SwWrtShell *pSh = GetWrtShell();
if(pSh)
{
-
SvNumberFormatter* pFormatter = pSh->GetNumberFormatter();
LanguageType eLang = aFormatLB.GetCurLanguage();
if (nNewType == NUMBERFORMAT_DATE)
@@ -358,6 +388,10 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
aFormatLB.SetDefFormat(nFormat);
}
}
+ else if( (nSubType == DI_CUSTOM) && (nNewType != 0) )
+ {
+ aFormatLB.SetDefFormat(nFormat);
+ }
}
aFormatLB.Enable(bEnable);
diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx
index 2b72b1aec33a..0d46c873f342 100644
--- a/sw/source/ui/fldui/flddinf.hxx
+++ b/sw/source/ui/fldui/flddinf.hxx
@@ -33,15 +33,16 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#ifndef _SV_BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
#include <vcl/group.hxx>
#include <svtools/svtreebx.hxx>
#include "numfmtlb.hxx"
#include "fldpage.hxx"
+namespace com{namespace sun{ namespace star{ namespace beans{
+ class XPropertySet;
+}}}}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -57,7 +58,7 @@ class SwFldDokInfPage : public SwFldPage
CheckBox aFixedCB;
SvLBoxEntry* pSelEntry;
- com::sun::star::uno::Sequence < ::rtl::OUString > aPropertyNames;
+ com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet;
String aInfoStr;
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index c0ee8f2e0a98..318ca160c670 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -226,15 +226,15 @@ SfxTabPage* SwFldEditDlg::CreatePage(USHORT nGroup)
uno::Reference< beans::XPropertySet > xUDProps(
xDocProps->getUserDefinedProperties(),
uno::UNO_QUERY_THROW);
- uno::Reference< beans::XPropertySetInfo > xSetInfo
- = xUDProps->getPropertySetInfo();
- const uno::Sequence< beans::Property > props
- = xSetInfo->getProperties();
- uno::Sequence< ::rtl::OUString > names(props.getLength());
- for (sal_Int32 i = 0; i < props.getLength(); ++i) {
- names[i] = props[i].Name;
- }
- pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(names) ) );
+// uno::Reference< beans::XPropertySetInfo > xSetInfo
+// = xUDProps->getPropertySetInfo();
+// const uno::Sequence< beans::Property > props
+// = xSetInfo->getProperties();
+// uno::Sequence< ::rtl::OUString > names(props.getLength());
+// for (sal_Int32 i = 0; i < props.getLength(); ++i) {
+// names[i] = props[i].Name;
+// }
+ pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) );
pTabPage = SwFldDokInfPage::Create(this, *pSet);
nHelpId = HID_EDIT_FLD_DOKINF;
break;
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 0de17286fcad..31388cd2e51e 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -48,47 +48,23 @@
#include <vcl/msgbox.hxx>
#include <svx/htmlmode.hxx>
#include <viewopt.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <fldwrap.hxx>
-#ifndef _FLDDB_HXX
#include <flddb.hxx>
-#endif
-#ifndef _FLDDINF_HXX
#include <flddinf.hxx>
-#endif
-#ifndef _FLDVAR_HXX
#include <fldvar.hxx>
-#endif
-#ifndef _FLDDOK_HXX
#include <flddok.hxx>
-#endif
-#ifndef _FLDFUNC_HXX
#include <fldfunc.hxx>
-#endif
-#ifndef _FLDREF_HXX
#include <fldref.hxx>
-#endif
#include <wrtsh.hxx>
#include <view.hxx>
-#ifndef _FLDTDLG_HXX
#include <fldtdlg.hxx>
-#endif
#include <swmodule.hxx>
-#ifndef _HELPID_H
#include <helpid.h>
-#endif
-#ifndef _FLDUI_HRC
#include <fldui.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _FLDTDLG_HRC
#include <fldtdlg.hrc>
-#endif
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -245,15 +221,7 @@ SfxItemSet* SwFldDlg::CreateInputItemSet( USHORT nID )
uno::Reference< beans::XPropertySet > xUDProps(
xDocProps->getUserDefinedProperties(),
uno::UNO_QUERY_THROW);
- uno::Reference< beans::XPropertySetInfo > xSetInfo
- = xUDProps->getPropertySetInfo();
- const uno::Sequence< beans::Property > props
- = xSetInfo->getProperties();
- uno::Sequence< ::rtl::OUString > names(props.getLength());
- for (sal_Int32 i = 0; i < props.getLength(); ++i) {
- names[i] = props[i].Name;
- }
- pISet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(names) ) );
+ pISet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) );
return pISet;
}
else
diff --git a/sw/source/ui/fldui/makefile.mk b/sw/source/ui/fldui/makefile.mk
index a94fdaef17e7..23160cf80fb8 100644
--- a/sw/source/ui/fldui/makefile.mk
+++ b/sw/source/ui/fldui/makefile.mk
@@ -80,6 +80,7 @@ SLOFILES = \
EXCEPTIONSFILES = \
$(SLO)$/fldtdlg.obj \
$(SLO)$/fldedt.obj \
+ $(SLO)$/flddinf.obj \
$(SLO)$/xfldui.obj
LIB1TARGET = $(SLB)$/$(TARGET).lib
diff --git a/sw/source/ui/inc/maildispatcher.hxx b/sw/source/ui/inc/maildispatcher.hxx
index 4a0ad7239116..44cb3b2a4707 100644
--- a/sw/source/ui/inc/maildispatcher.hxx
+++ b/sw/source/ui/inc/maildispatcher.hxx
@@ -131,7 +131,6 @@ public:
/** returns if the thread is still running
*/
using osl::Thread::isRunning;
- bool isRunning() const;
/** returns if shutdown has already been called
*/
@@ -167,7 +166,6 @@ private:
::rtl::Reference<MailDispatcher> m_xSelfReference;
bool run_;
bool shutdown_requested_;
- bool bIsInRun;
};
#endif // INCLUDED_MAILDISPATCHER_HXX
diff --git a/sw/source/ui/table/convert.src b/sw/source/ui/table/convert.src
index 44a8923d9e48..983cf90dac08 100644
--- a/sw/source/ui/table/convert.src
+++ b/sw/source/ui/table/convert.src
@@ -177,7 +177,7 @@ ModalDialog DLG_CONV_TEXT_TABLE
PushButton BT_AUTOFORMAT
{
Pos = MAP_APPFONT ( 12 , 152 ) ;
- Size = MAP_APPFONT ( 66 , 14 ) ;
+ Size = MAP_APPFONT ( 86 , 14 ) ;
TabStop = TRUE ;
Hide = TRUE ;
Text [ en-US ] = "Auto~Format..." ;
diff --git a/sw/source/ui/table/instable.src b/sw/source/ui/table/instable.src
index ca5680ebf494..ebe03f5f364b 100644
--- a/sw/source/ui/table/instable.src
+++ b/sw/source/ui/table/instable.src
@@ -159,7 +159,7 @@ ModalDialog DLG_INSERT_TABLE
PushButton BT_AUTOFORMAT
{
Pos = MAP_APPFONT ( 12 , 146 ) ;
- Size = MAP_APPFONT ( 66 , 14 ) ;
+ Size = MAP_APPFONT ( 86 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Auto~Format..." ;
};
diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx
index 86b8340849f5..c53f6efbc3fc 100644
--- a/sw/source/ui/uiview/viewprt.cxx
+++ b/sw/source/ui/uiview/viewprt.cxx
@@ -252,7 +252,10 @@ ErrCode SwView::DoPrint( SfxPrinter *pPrinter, PrintDialog *pDlg, BOOL bSilent,
QueryBox aBox( &GetEditWin(), SW_RES( DLG_PRT_FIELDNAME ) );
USHORT nRet = aBox.Execute();
if( RET_CANCEL == nRet)
+ {
+ delete pProgress;
return ERRCODE_IO_ABORT;
+ }
// disable field commands
if( RET_NO != nRet )
{
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index 7581703eb6d8..ec3328676d2b 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -169,6 +169,7 @@ ShellResource::ShellResource()
aStrAllPageHeadFoot( SW_RES( STR_ALLPAGE_HEADFOOT ) ),
aStrNone( SW_RES( STR_TEMPLATE_NONE )),
aFixedStr( SW_RES( STR_FIELD_FIXED )),
+ sDurationFormat( SW_RES( STR_DURATION_FORMAT )),
aTOXIndexName( SW_RES(STR_TOI)),
aTOXUserName( SW_RES(STR_TOU)),
diff --git a/sw/source/ui/utlui/initui.hrc b/sw/source/ui/utlui/initui.hrc
index 5e0c5092d6f6..6c3c0302dbbd 100644
--- a/sw/source/ui/utlui/initui.hrc
+++ b/sw/source/ui/utlui/initui.hrc
@@ -64,5 +64,6 @@
#define STR_PAGEDESC_FOLLOWNAME 27
#define STR_HYPERLINK_CLICK 28
#define STR_GETREFFLD_REFITEMNOTFOUND 29
+#define STR_DURATION_FORMAT 30
#endif
diff --git a/sw/source/ui/utlui/initui.src b/sw/source/ui/utlui/initui.src
index d8ebdfc7e64e..26b10dcd0804 100644
--- a/sw/source/ui/utlui/initui.src
+++ b/sw/source/ui/utlui/initui.src
@@ -112,6 +112,10 @@ Resource RID_SW_SHELLRES
{
Text [ en-US ] = "(fixed)" ;
};
+ String STR_DURATION_FORMAT
+ {
+ Text [en-US] = " Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6";
+ };
String STR_TOI
{
Text [ en-US ] = "Alphabetical Index" ;