You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ja...@apache.org on 2013/02/03 14:24:38 UTC
svn commit: r1441909 [35/45] - in /openoffice/branches/l10n: ./
ext_libraries/apr-util/ ext_libraries/apr/ ext_libraries/hunspell/
ext_sources/ extras/l10n/source/ast/ extras/l10n/source/da/
extras/l10n/source/eu/ extras/l10n/source/gd/ extras/l10n/sou...
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.cxx Sun Feb 3 13:23:59 2013
@@ -1285,7 +1285,8 @@ void RtfAttributeOutput::NumberingLevel(
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 /*nListTabPos*/,
- const String &rNumberingString )
+ const String &rNumberingString,
+ const SvxBrushItem* /* pBrush */)
{
OSL_TRACE("%s", OSL_THIS_FUNC);
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/rtfattributeoutput.hxx Sun Feb 3 13:23:59 2013
@@ -220,7 +220,8 @@ public:
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString );
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush = 0);//For i120928,to export graphic of bullet
void WriteField_Impl( const SwField* pFld, ww::eField eType, const String& rFldCmd, sal_uInt8 nMode );
void WriteBookmarks_Impl( std::vector< rtl::OUString >& rStarts, std::vector< rtl::OUString >& rEnds );
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.cxx Sun Feb 3 13:23:59 2013
@@ -193,6 +193,12 @@ void RtfExport::AppendBookmark( const OU
m_pAttrOutput->WriteBookmarks_Impl(aStarts, aEnds);
}
+//For i120928,to export graphic of bullet for RTF filter
+void RtfExport::ExportGrfBullet(const SwTxtNode& /* rNd */)
+{
+ //This is for RTF filter on the graphic bullets
+}
+
void RtfExport::WriteChar( sal_Unicode )
{
OSL_TRACE("%s", OSL_THIS_FUNC);
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/rtfexport.hxx Sun Feb 3 13:23:59 2013
@@ -86,6 +86,9 @@ public:
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+ //For i120928,add an interface to export graphic of bullet
+ virtual void ExportGrfBullet(const SwTxtNode& rNd);
+
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t()*/ ) { /* no-op for rtf, most probably should not even be in MSWordExportBase */ }
virtual void WriteChar( sal_Unicode );
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.cxx Sun Feb 3 13:23:59 2013
@@ -58,7 +58,9 @@
# include <unotools/streamwrap.hxx>
#endif
#include <numrule.hxx>
-
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>//For i120928
+#endif
#ifdef DEBUGDUMP
# include <vcl/svapp.hxx>
# ifndef _TOOLS_URLOBJ_HXX
@@ -180,6 +182,32 @@ namespace
namespace sw
{
+ //For i120928,size conversion before exporting graphic of bullet
+ Frame::Frame(const Graphic&rGrf, const SwPosition &rPos)
+ :mpFlyFrm(NULL),
+ maPos(rPos),
+ maSize(),
+ maLayoutSize(),
+ meWriterType(eBulletGrf),
+ mpStartFrameContent(0),
+ mbIsInline(true),
+ mbForBullet(true),
+ maGrf(rGrf)
+ {
+ const MapMode aMap100mm( MAP_100TH_MM );
+ Size aSize( rGrf.GetPrefSize() );
+ if ( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ {
+ aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap100mm );
+ }
+ else
+ {
+ aSize = OutputDevice::LogicToLogic( aSize,rGrf.GetPrefMapMode(), aMap100mm );
+ }
+ maSize = aSize;
+ maLayoutSize = maSize;
+ }
+
Frame::Frame(const SwFrmFmt &rFmt, const SwPosition &rPos)
: mpFlyFrm(&rFmt),
maPos(rPos),
@@ -192,6 +220,9 @@ namespace sw
// --> OD 2007-04-19 #i43447# - move to initialization list
mbIsInline( (rFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR) )
// <--
+ //For i120928,handle graphic of bullet within existing implementation
+ ,mbForBullet(false)
+ ,maGrf()
{
switch (rFmt.Which())
{
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/writerhelper.hxx Sun Feb 3 13:23:59 2013
@@ -107,7 +107,7 @@ namespace sw
class Frame
{
public:
- enum WriterSource {eTxtBox, eGraphic, eOle, eDrawing, eFormControl};
+ enum WriterSource {eTxtBox, eGraphic, eOle, eDrawing, eFormControl,eBulletGrf};//For i120928,add Grf Bul Type
private:
const SwFrmFmt* mpFlyFrm;
SwPosition maPos;
@@ -121,9 +121,12 @@ namespace sw
WriterSource meWriterType;
const SwNode *mpStartFrameContent;
bool mbIsInline;
+ bool mbForBullet:1;
+ Graphic maGrf;
public:
Frame(const SwFrmFmt &rFlyFrm, const SwPosition &rPos);
-
+ Frame(const Graphic&, const SwPosition &);
+ //End
/** Get the writer SwFrmFmt that this object describes
@return
@@ -177,6 +180,8 @@ namespace sw
the first node of content in the frame, might not be any at all.
*/
const SwNode *GetContent() const { return mpStartFrameContent; }
+ const Graphic &GetGraphic() const { return maGrf; }
+ bool HasGraphic() const { return mbForBullet; }
/** Does this sw::Frame refer to the same writer content as another
@@ -186,7 +191,12 @@ namespace sw
*/
bool RefersToSameFrameAs(const Frame &rOther) const
{
- return (mpFlyFrm == rOther.mpFlyFrm);
+ if (mbForBullet && rOther.mbForBullet)
+ return (maGrf == rOther.maGrf);
+ else if ((!mbForBullet) && (!rOther.mbForBullet))
+ return (mpFlyFrm == rOther.mpFlyFrm);
+
+ return false;
}
/** The Size of the contained element
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8esh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8esh.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8esh.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8esh.cxx Sun Feb 3 13:23:59 2013
@@ -103,11 +103,232 @@
// <--
#include "WW8FFData.hxx"
#include <editeng/shaditem.hxx>
+#include <svx/unoapi.hxx>
+#include <escher.hxx>
+#include <fmtinfmt.hxx>
+#include <fmturl.hxx>
+#include "sfx2/sfxsids.hrc"
+#include <svl/urihelper.hxx>
+#include <unotools/saveopt.hxx>
using namespace com::sun::star;
using namespace sw::util;
using namespace sw::types;
using namespace nsFieldFlags;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::beans::XPropertySet;
+using ::com::sun::star::drawing::XShape;
+
+bool SwBasicEscherEx::IsRelUrl()
+{
+ SvtSaveOptions aSaveOpt;
+ bool bRelUrl = false;
+ SfxMedium * pMedium = rWrt.GetWriter().GetMedia();
+ if ( pMedium )
+ bRelUrl = pMedium->IsRemote() ? aSaveOpt.IsSaveRelINet() : aSaveOpt.IsSaveRelFSys();
+ return bRelUrl;
+}
+
+String SwBasicEscherEx::GetBasePath()
+{
+ String sDocUrl;
+ String sBasePath;
+ SfxMedium * pMedium = rWrt.GetWriter().GetMedia();
+ if ( pMedium )
+ {
+ const SfxItemSet* pPItemSet = pMedium->GetItemSet();
+ if( pPItemSet )
+ {
+ const SfxStringItem* pPItem = dynamic_cast< const SfxStringItem* >( pPItemSet->GetItem( SID_FILE_NAME ) );
+ if ( pPItem )
+ sDocUrl = pPItem->GetValue();
+ }
+ }
+
+ sBasePath = sDocUrl.Copy( 0, sDocUrl.SearchBackward( '/' ) + 1 );
+ return sBasePath;
+
+}
+
+String SwBasicEscherEx::BuildFileName(sal_uInt16& rnLevel, bool& rbRel, const String& rUrl )
+{
+ String aDosName( INetURLObject( rUrl ).getFSysPath( INetURLObject::FSYS_DOS ) );
+ rnLevel = 0;
+ rbRel = IsRelUrl();
+
+ if( rbRel )
+ {
+ // try to convert to relative file name
+ String aTmpName( aDosName );
+ aDosName = INetURLObject::GetRelURL( GetBasePath(), rUrl,
+ INetURLObject::WAS_ENCODED, INetURLObject::DECODE_WITH_CHARSET );
+
+ if( aDosName.SearchAscii( INET_FILE_SCHEME ) == 0 )
+ {
+ // not converted to rel -> back to old, return absolute flag
+ aDosName = aTmpName;
+ rbRel = false;
+ }
+ else if( aDosName.SearchAscii( "./" ) == 0 )
+ {
+ aDosName.Erase( 0, 2 );
+ }
+ else
+ {
+ while( aDosName.SearchAndReplaceAscii( "../", String::EmptyString() ) == 0 )
+ ++rnLevel;
+ }
+ }
+ return aDosName;
+}
+
+void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFmtURL* pINetFmtArg)
+{
+ if ( !pINetFmtArg ) return;
+
+ sal_uInt8 maGuidStdLink[ 16 ] ={
+ 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B };
+ sal_uInt8 maGuidUrlMoniker[ 16 ] = {
+ 0xE0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B };
+
+ sal_uInt8 maGuidFileMoniker[ 16 ] = {
+ 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 };
+ sal_uInt8 maGuidFileTail[] = {
+ 0xFF, 0xFF, 0xAD, 0xDE, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ };
+ //const sal_uInt16 WW8_ID_HLINK = 0x01B8;
+ const sal_uInt32 WW8_HLINK_BODY = 0x00000001; /// Contains file link or URL.
+ const sal_uInt32 WW8_HLINK_ABS = 0x00000002; /// Absolute path.
+ //const sal_uInt32 WW8_HLINK_DESCR = 0x00000014; /// Description.
+ const sal_uInt32 WW8_HLINK_MARK = 0x00000008; /// Text mark.
+ const sal_uInt32 WW8_HLINK_FRAME = 0x00000080; /// Target frame.
+ //const sal_uInt32 WW8_HLINK_UNC = 0x00000100; /// UNC path.
+ SvMemoryStream tmpStrm;
+ String tmpTextMark;
+
+ String rUrl = pINetFmtArg->GetURL();
+ String rTarFrm = pINetFmtArg->GetTargetFrameName();
+ sal_uInt32 mnFlags = 0;
+
+ INetURLObject aUrlObj( rUrl );
+ const INetProtocol eProtocol = aUrlObj.GetProtocol();
+
+ //Target Frame
+ if( rTarFrm.Len() > 0 )
+ {
+ SwWW8Writer::WriteLong( tmpStrm, rTarFrm.Len()+1 );
+ SwWW8Writer::WriteString16( tmpStrm, rTarFrm, false);
+
+ tmpStrm << sal_uInt16( 0 );
+
+ mnFlags |= WW8_HLINK_FRAME;
+ }
+
+ // file link or URL
+ if( eProtocol == INET_PROT_FILE || (eProtocol == INET_PROT_NOT_VALID && rUrl.GetChar( 0 ) != '#') )
+ {
+ sal_uInt16 nLevel;
+ bool bRel;
+ String aFileName( BuildFileName( nLevel, bRel, rUrl ));
+
+ if( !bRel )
+ mnFlags |= WW8_HLINK_ABS;
+
+ mnFlags |= WW8_HLINK_BODY;
+
+ tmpStrm.Write( maGuidFileMoniker,sizeof(maGuidFileMoniker) );
+ tmpStrm << nLevel;
+ SwWW8Writer::WriteLong( tmpStrm, aFileName.Len()+1);
+ SwWW8Writer::WriteString8( tmpStrm, aFileName, true, RTL_TEXTENCODING_MS_1252 );
+ tmpStrm.Write( maGuidFileTail,sizeof(maGuidFileTail) );
+
+ //For UNICODE
+ SwWW8Writer::WriteLong( tmpStrm, 2*aFileName.Len()+6);
+ SwWW8Writer::WriteLong( tmpStrm, 2*aFileName.Len());
+ tmpStrm << sal_uInt16(0x0003);
+ SwWW8Writer::WriteString16(tmpStrm, aFileName, false);
+ }
+ else if( eProtocol != INET_PROT_NOT_VALID )
+ {
+ tmpStrm.Write( maGuidUrlMoniker,sizeof(maGuidUrlMoniker) );
+ SwWW8Writer::WriteLong( tmpStrm, 2*(rUrl.Len()+1));
+
+ SwWW8Writer::WriteString16(tmpStrm, rUrl, true);
+ mnFlags |= WW8_HLINK_BODY | WW8_HLINK_ABS;
+ }
+ else if( rUrl.GetChar( 0 ) == '#' )
+ {
+ String aTextMark( rUrl.Copy( 1 ) );
+ aTextMark.SearchAndReplace( '.', '!' );
+ //sal_uInt8 tmpLen = aTextMark.Len();
+ tmpTextMark = aTextMark;
+ }
+
+ if( tmpTextMark.Len() == 0 && aUrlObj.HasMark() )
+ {
+ tmpTextMark = aUrlObj.GetMark();
+ }
+
+ if( tmpTextMark.Len()>0 )
+ {
+ SwWW8Writer::WriteLong( tmpStrm, tmpTextMark.Len()+1);
+ SwWW8Writer::WriteString16(tmpStrm, tmpTextMark, true);
+
+ mnFlags |= WW8_HLINK_MARK;
+ }
+
+ rStrm.Write( maGuidStdLink,16 );
+ rStrm << sal_uInt32( 2 )
+ << mnFlags;
+ tmpStrm.Seek( STREAM_SEEK_TO_BEGIN );
+ sal_uInt32 nStrmPos = tmpStrm.Tell();
+ tmpStrm.Seek( STREAM_SEEK_TO_END );
+ sal_uInt32 nStrmSize = tmpStrm.Tell();
+ tmpStrm.Seek( nStrmPos );
+ sal_uInt32 nLen;
+ nLen = nStrmSize - nStrmPos;
+ if(nLen >0)
+ {
+ sal_uInt8* pBuffer = new sal_uInt8[ nLen ];
+ tmpStrm.Read(pBuffer, nLen);
+ rStrm.Write( pBuffer, nLen );
+ delete[] pBuffer;
+ }
+}
+void SwBasicEscherEx::PreWriteHyperlinkWithinFly(const SwFrmFmt& rFmt,EscherPropertyContainer& rPropOpt)
+{
+ const SfxPoolItem* pItem;
+ const SwAttrSet& rAttrSet = rFmt.GetAttrSet();
+ if (SFX_ITEM_SET == rAttrSet.GetItemState(RES_URL, true, &pItem))
+ {
+ const SwFmtURL *pINetFmt = dynamic_cast<const SwFmtURL*>(pItem);
+ if(pINetFmt && pINetFmt->GetURL().Len()>0)
+ {
+ SvMemoryStream *rStrm = new SvMemoryStream ;
+ String tmpstr=pINetFmt->GetURL();
+ WriteHyperlinkWithinFly( *rStrm, pINetFmt );
+ sal_uInt8* pBuf = (sal_uInt8*) rStrm->GetData();
+ sal_uInt32 nSize = rStrm->Seek( STREAM_SEEK_TO_END );
+ rPropOpt.AddOpt( ESCHER_Prop_pihlShape, sal_True, nSize, pBuf, nSize );
+ sal_uInt32 nValue;
+ String aNamestr = pINetFmt->GetName();
+ if(aNamestr.Len()>0)
+ {
+ rPropOpt.AddOpt(ESCHER_Prop_wzName, aNamestr );
+ }
+ if(rPropOpt.GetOpt( ESCHER_Prop_fPrint, nValue))
+ {
+ nValue|=0x03080008;
+ rPropOpt.AddOpt(ESCHER_Prop_fPrint, nValue );
+ }
+ else
+ rPropOpt.AddOpt(ESCHER_Prop_fPrint, 0x03080008 );
+ }
+ }
+}
//#110185# get a part fix for this type of element
bool WW8Export::MiserableFormFieldExportHack(const SwFrmFmt& rFrmFmt)
@@ -1351,6 +1572,57 @@ sal_uInt32 AddMirrorFlags(sal_uInt32 nFl
}
return nFlags;
}
+//For i120928,this function is added to export graphic of bullet
+sal_Int32 SwBasicEscherEx::WriteGrfBullet(const Graphic& rGrf)
+{
+ OpenContainer( ESCHER_SpContainer );
+ AddShape(ESCHER_ShpInst_PictureFrame, 0xa00,0x401);
+ EscherPropertyContainer aPropOpt;
+ GraphicObject aGraphicObject( rGrf );
+ ByteString aUniqueId = aGraphicObject.GetUniqueID();
+ if ( aUniqueId.Len() )
+ {
+ const MapMode aMap100mm( MAP_100TH_MM );
+ Size aSize( rGrf.GetPrefSize() );
+ if ( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() )
+ {
+ aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap100mm );
+ }
+ else
+ {
+ aSize = OutputDevice::LogicToLogic( aSize,rGrf.GetPrefMapMode(), aMap100mm );
+ }
+ Point aEmptyPoint = Point();
+ Rectangle aRect( aEmptyPoint, aSize );
+ sal_uInt32 nBlibId = mxGlobal->GetBlibID( *(mxGlobal->QueryPictureStream()), aUniqueId,aRect, NULL, 0 );
+ if (nBlibId)
+ aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
+ }
+ aPropOpt.AddOpt( ESCHER_Prop_pibFlags, ESCHER_BlipFlagDefault );
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextTop, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextRight, DrawModelToEmu(0));
+ aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextTop, 0 );
+ aPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, 0 );
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 );
+ aPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
+ const Color aTmpColor( COL_WHITE );
+ SvxBrushItem aBrush( aTmpColor, RES_BACKGROUND );
+ const SvxBrushItem *pRet = rWrt.GetCurrentPageBgBrush();
+ if (pRet && (pRet->GetGraphic() ||( pRet->GetColor() != COL_TRANSPARENT)))
+ aBrush = *pRet;
+ WriteBrushAttr(aBrush, aPropOpt);
+
+ aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0 );
+ aPropOpt.Commit( GetStream() );
+ AddAtom(4, ESCHER_ClientAnchor);
+ GetStream() << (sal_uInt32)0x80000000;
+ CloseContainer();
+
+ return 0;
+}
sal_Int32 SwBasicEscherEx::WriteGrfFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nShapeId)
{
@@ -1791,6 +2063,8 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrame
{
rPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 );
}
+
+ PreWriteHyperlinkWithinFly(rFmt,rPropOpt);
return nLineWidth;
}
@@ -1885,6 +2159,8 @@ sal_Int32 SwEscherEx::WriteFlyFrameAttr(
}
}
+ PreWriteHyperlinkWithinFly(rFmt,rPropOpt);
+
return nLineWidth;
}
@@ -2006,34 +2282,38 @@ SwEscherEx::SwEscherEx(SvStream* pStrm,
case sw::Frame::eFormControl:
WriteOCXControl(rFmt, nShapeId = GenerateShapeId());
break;
- case sw::Frame::eDrawing:
- aWinwordAnchoring.SetAnchoring(rFmt);
- const SdrObject* pSdrObj = rFmt.FindRealSdrObject();
- if (pSdrObj)
- {
- bool bSwapInPage = false;
- if (!pSdrObj->GetPage())
+ case sw::Frame::eDrawing: {
+ aWinwordAnchoring.SetAnchoring(rFmt);
+ const SdrObject* pSdrObj = rFmt.FindRealSdrObject();
+ if (pSdrObj)
{
- if (SdrModel* pModel = rWrt.pDoc->GetDrawModel())
+ bool bSwapInPage = false;
+ if (!pSdrObj->GetPage())
{
- if (SdrPage *pPage = pModel->GetPage(0))
+ if (SdrModel* pModel = rWrt.pDoc->GetDrawModel())
{
- bSwapInPage = true;
- (const_cast<SdrObject*>(pSdrObj))->SetPage(pPage);
+ if (SdrPage *pPage = pModel->GetPage(0))
+ {
+ bSwapInPage = true;
+ (const_cast<SdrObject*>(pSdrObj))->SetPage(pPage);
+ }
}
}
- }
- nShapeId = AddSdrObject(*pSdrObj);
+ nShapeId = AddSdrObject(*pSdrObj);
- if (bSwapInPage)
- (const_cast<SdrObject*>(pSdrObj))->SetPage(0);
- }
+ if (bSwapInPage)
+ (const_cast<SdrObject*>(pSdrObj))->SetPage(0);
+ }
#ifdef DBG_UTIL
- else
- ASSERT( !this, "Where is the SDR-Object?" );
+ else
+ ASSERT( !this, "Where is the SDR-Object?" );
#endif
- }
+ }
+ break;
+ default:
+ break;
+ }
if( !nShapeId )
{
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8nds.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8nds.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8nds.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8nds.cxx Sun Feb 3 13:23:59 2013
@@ -1782,6 +1782,16 @@ void MSWordExportBase::OutputTextNode( c
ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo( mpTableInfo->getTableNodeInfo( &rNode ) );
+ //For i120928,identify the last node
+ bool bLastCR = false;
+ bool bExported = false;
+ {
+ SwNodeIndex aNextIdx(rNode,1);
+ SwNodeIndex aLastIdx(rNode.GetNodes().GetEndOfContent());
+ if (aNextIdx == aLastIdx)
+ bLastCR = true;
+ }
+
AttrOutput().StartParagraph( pTextNodeInfo );
bool bFlyInTable = mpParentFrame && IsInTable();
@@ -1957,6 +1967,13 @@ void MSWordExportBase::OutputTextNode( c
m_aCurrentCharPropStarts.pop();
AttrOutput().EndTOX( *pTOXSect ,false);
}
+ //For i120928,the position of the bullet's graphic is at end of doc
+ if (bLastCR && (!bExported))
+ {
+ ExportGrfBullet(rNode);
+ bExported = true;
+ }
+
WriteCR( pTextNodeInfoInner );
}
}
@@ -1994,6 +2011,12 @@ void MSWordExportBase::OutputTextNode( c
// insert final bookmarks if any before CR and after flys
AppendBookmarks( rNode, nEnd, 1 );
WriteCR( pTextNodeInfoInner );
+ //For i120928,the position of the bullet's graphic is at end of doc
+ if (bLastCR && (!bExported))
+ {
+ ExportGrfBullet(rNode);
+ bExported = true;
+ }
if ( pTOXSect )
{
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8num.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8num.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8num.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/wrtw8num.cxx Sun Feb 3 13:23:59 2013
@@ -214,7 +214,8 @@ void WW8AttributeOutput::NumberingLevel(
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush //For i120928,to transfer graphic of bullet
)
{
// Start value
@@ -272,6 +273,18 @@ void WW8AttributeOutput::NumberingLevel(
}
m_rWW8Export.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rWW8Export.mbExportModeRTF );
+ //For i120928,achieve graphic's index of bullet from the bullet bookmark
+ if (SVX_NUM_BITMAP == nNumberingType && pBrush)
+ {
+ int nIndex = m_rWW8Export.GetGrfIndex(*pBrush);
+ if ( nIndex != -1 )
+ {
+ m_rWW8Export.InsUInt16(0x6887);
+ m_rWW8Export.InsUInt32(nIndex);
+ m_rWW8Export.InsUInt16(0x4888);
+ m_rWW8Export.InsUInt16(1);
+ }
+ }
m_rWW8Export.pO = pOldpO;
}
@@ -506,8 +519,9 @@ void MSWordExportBase::AbstractNumbering
nFollow,
pPseudoFont, pOutSet,
nIndentAt, nFirstLineIndex, nListTabPos,
- sNumStr );
-
+ sNumStr,
+ rFmt.GetNumberingType()==SVX_NUM_BITMAP ? rFmt.GetBrush():0);//Start for i120928,export graphic bullet,2012.9.25
+
delete pPseudoFont;
}
AttrOutput().EndAbstractNumbering();
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.cxx Sun Feb 3 13:23:59 2013
@@ -122,7 +122,9 @@
#include "WW8Sttbf.hxx"
#include <editeng/charrotateitem.hxx>
#include "WW8FibData.hxx"
-
+#ifndef _NUMRULE_HXX
+#include "numrule.hxx"//For i120928
+#endif
using namespace sw::util;
using namespace sw::types;
@@ -312,7 +314,7 @@ void WW8_WrtBookmarks::MoveFieldMarks(sa
{
if (aItr->second)
{
- if (aItr->second->first == nFrom)
+ if (aItr->second->first == (long)nFrom)
{
aItr->second->second.first = true;
aItr->second->first = nTo;
@@ -1424,6 +1426,125 @@ void WW8Export::AppendBookmark( const rt
pBkmks->Append( nSttCP, rName );
}
+//For i120928,collect all the graphics of bullets applied to paragraphs
+int WW8Export::CollectGrfsOfBullets() const
+{
+ m_vecBulletPic.clear();
+
+ if ( pDoc )
+ {
+ sal_uInt16 nCountRule = pDoc->GetNumRuleTbl().Count();
+ for (sal_uInt16 n = 0; n < nCountRule; ++n)
+ {
+ const SwNumRule &rRule = *(pDoc->GetNumRuleTbl().GetObject(n));
+ sal_uInt16 nLevels = rRule.IsContinusNum() ? 1 : 9;
+ for (sal_uInt16 nLvl = 0; nLvl < nLevels; ++nLvl)
+ {
+ const SwNumFmt &rFmt = rRule.Get(nLvl);
+ if (SVX_NUM_BITMAP != rFmt.GetNumberingType())
+ {
+ continue;
+ }
+ const Graphic *pGrf = rFmt.GetBrush()? rFmt.GetBrush()->GetGraphic():0;
+ if ( pGrf )
+ {
+ bool bHas = false;
+ for (sal_uInt16 i = 0; i < m_vecBulletPic.size(); ++i)
+ {
+ if (m_vecBulletPic[i]->GetChecksum() == pGrf->GetChecksum())
+ {
+ bHas = true;
+ break;
+ }
+ }
+ if (!bHas)
+ {
+ m_vecBulletPic.push_back(pGrf);
+ }
+ }
+ }
+ }
+ }
+
+ return m_vecBulletPic.size();
+}
+//Export Graphic of Bullets
+void WW8Export::ExportGrfBullet(const SwTxtNode& rNd)
+{
+ int nCount = CollectGrfsOfBullets();
+ if (nCount > 0)
+ {
+ SwPosition aPos(rNd);
+ String aPicBullets = String::CreateFromAscii("_PictureBullets");
+ AppendBookmark(aPicBullets);
+ for (int i = 0; i < nCount; i++)
+ {
+ sw::Frame aFrame(*(m_vecBulletPic[i]), aPos);
+ OutGrfBullets(aFrame);
+ }
+ AppendBookmark(aPicBullets);
+ }
+}
+
+static sal_uInt8 nAttrMagicIdx = 0;
+void WW8Export::OutGrfBullets(const sw::Frame & rFrame)
+{
+ if ( !pGrf || !pChpPlc || !pO )
+ return;
+
+ pGrf->Insert(rFrame);
+ pChpPlc->AppendFkpEntry( Strm().Tell(), pO->Count(), pO->GetData() );
+ pO->Remove( 0, pO->Count() );
+ //if links...
+ WriteChar( (char)1 );
+
+ sal_uInt8 aArr[ 22 ];
+ sal_uInt8* pArr = aArr;
+
+ // sprmCFSpec
+ if( bWrtWW8 )
+ Set_UInt16( pArr, 0x855 );
+ else
+ Set_UInt8( pArr, 117 );
+ Set_UInt8( pArr, 1 );
+
+ Set_UInt16( pArr, 0x083c );
+ Set_UInt8( pArr, 0x81 );
+
+ // sprmCPicLocation
+ if( bWrtWW8 )
+ Set_UInt16( pArr, 0x6a03 );
+ else
+ {
+ Set_UInt8( pArr, 68 );
+ Set_UInt8( pArr, 4 );
+ }
+ Set_UInt32( pArr, GRF_MAGIC_321 );
+
+ //extern nAttrMagicIdx;
+ --pArr;
+ Set_UInt8( pArr, nAttrMagicIdx++ );
+ pChpPlc->AppendFkpEntry( Strm().Tell(), static_cast< short >(pArr - aArr), aArr );
+}
+//Achieve the index position
+int WW8Export::GetGrfIndex(const SvxBrushItem& rBrush)
+{
+ int nIndex = -1;
+ if ( rBrush.GetGraphic() )
+ {
+ for (sal_uInt16 i = 0; i < m_vecBulletPic.size(); ++i)
+ {
+ if (m_vecBulletPic[i]->GetChecksum() == rBrush.GetGraphic()->GetChecksum())
+ {
+ nIndex = i;
+ break;
+ }
+ }
+ }
+
+ return nIndex;
+}
+
void MSWordExportBase::AppendWordBookmark( const String& rName )
{
AppendBookmark( BookmarkToWord( rName ) );
@@ -1917,14 +2038,14 @@ void WW8AttributeOutput::TableInfoRow( w
}
}
-static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, const sal_uInt32 nRowSpan)
+static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, const sal_Int32 nRowSpan)
{
sal_uInt16 nFlags = 0;
if (nRowSpan > 1)
nFlags |= (3 << 5);
- //else if (nRowSpan < 0)
- // nFlags |= (1 << 5);
+ else if (nRowSpan < 0)
+ nFlags |= (1 << 5);
if (pBox != NULL)
{
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8.hxx Sun Feb 3 13:23:59 2013
@@ -48,6 +48,9 @@
#include "../inc/msfilter.hxx"
#include <expfld.hxx>
+#include <vcl/graph.hxx>
+class SvxBrushItem;
+
// einige Forward Deklarationen
namespace msfilter
{
@@ -650,7 +653,9 @@ public:
virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen ) = 0;
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false ) = 0;
-
+ //For i120928,add this interface to export graphic of bullet
+ virtual void ExportGrfBullet(const SwTxtNode& rNd) = 0;
+
// FIXME probably a hack...
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t() ) = 0;
@@ -896,6 +901,8 @@ public:
using StgWriter::Write;
virtual sal_uLong Write( SwPaM&, SfxMedium&, const String* = 0 );
+ //Seems not an expected to provide method to access the private member
+ SfxMedium* GetMedia(){ return mpMedium;};
private:
/// No copying.
@@ -922,6 +929,9 @@ public:
sal_uInt8 bWrtWW8 : 1; ///< Write WW95 (false) or WW97 (true) file format
+ //For i120928,this vector is to record all the graphics of bullets
+ mutable std::vector<const Graphic*> m_vecBulletPic;
+
protected:
SwWW8Writer *m_pWriter; ///< Pointer to the writer
WW8AttributeOutput *m_pAttrOutput; ///< Converting attributes to stream data
@@ -1024,6 +1034,12 @@ public:
virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen );
virtual void AppendBookmark( const rtl::OUString& rName, bool bSkip = false );
+
+ virtual void ExportGrfBullet(const SwTxtNode& rNd);
+ int CollectGrfsOfBullets() const;
+ void OutGrfBullets(const sw::Frame &rFrame);
+ int GetGrfIndex(const SvxBrushItem& rBrush);
+
void MoveFieldMarks(sal_uLong nFrom, sal_uLong nTo);
void WriteAsStringTable(const ::std::vector<String>&, sal_Int32& rfcSttbf,
@@ -1360,6 +1376,9 @@ private:
void WriteGrfFromGrfNode(SvStream& rStrm, const SwGrfNode &rNd,
const sw::Frame &rFly, sal_uInt16 nWidth, sal_uInt16 nHeight);
+ void WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight);
+ void WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight);
+
//No copying
SwWW8WrGrf(const SwWW8WrGrf&);
SwWW8WrGrf& operator=(const SwWW8WrGrf&);
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8gr.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8gr.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8gr.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/wrtww8gr.cxx Sun Feb 3 13:23:59 2013
@@ -764,6 +764,135 @@ void SwWW8WrGrf::WriteGrfFromGrfNode(SvS
}
}
}
+//For i120928,export graphic info of bullet
+void SwWW8WrGrf::WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf,
+ sal_uInt16 mm, sal_uInt16 nWidth, sal_uInt16 nHeight)
+{
+ sal_Int16 nXSizeAdd = 0, nYSizeAdd = 0;
+ sal_Int16 nCropL = 0, nCropR = 0, nCropT = 0, nCropB = 0;
+
+ Size aGrTwipSz(rGrf.GetPrefSize());
+ bool bWrtWW8 = rWrt.bWrtWW8;
+ sal_uInt16 nHdrLen = bWrtWW8 ? 0x44 : 0x3A;
+
+ sal_uInt8 aArr[ 0x44 ] = { 0 };
+
+ sal_uInt8* pArr = aArr + 0x2E; //Do borders first
+
+ sal_uInt8 aLnArr[4] = { BOX_LINE_TOP, BOX_LINE_LEFT,
+ BOX_LINE_BOTTOM, BOX_LINE_RIGHT };
+ for( sal_uInt8 i = 0; i < 4; ++i )
+ {
+ WW8_BRC aBrc;
+
+ short nSpacing;
+ short nThick = aBrc.DetermineBorderProperties(!bWrtWW8,
+ &nSpacing);
+ switch (aLnArr[ i ])
+ {
+ case BOX_LINE_TOP:
+ case BOX_LINE_BOTTOM:
+ nHeight -= nThick;
+ nHeight = nHeight - nSpacing;
+ break;
+ case BOX_LINE_LEFT:
+ case BOX_LINE_RIGHT:
+ default:
+ nWidth -= nThick;
+ nWidth = nWidth - nSpacing;
+ break;
+ }
+ memcpy( pArr, &aBrc.aBits1, 2);
+ pArr+=2;
+
+ if( bWrtWW8 )
+ {
+ memcpy( pArr, &aBrc.aBits2, 2);
+ pArr+=2;
+ }
+ }
+
+ pArr = aArr + 4; //skip lcb
+ Set_UInt16( pArr, nHdrLen ); // set cbHeader
+
+ Set_UInt16( pArr, mm ); // set mm
+
+ if ( (aGrTwipSz.Width() * 254L / 144 > USHRT_MAX) || (aGrTwipSz.Height() * 254L / 144 > USHRT_MAX)
+ || (aGrTwipSz.Width() < 0 ) || (aGrTwipSz.Height() < 0) )
+ {
+ aGrTwipSz.Width() = nWidth;
+ aGrTwipSz.Height() = nHeight;
+ }
+ using namespace sw::types;
+ // set xExt & yExt
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Width() * 254L / 144));
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Height() * 254L / 144));
+ pArr += 16;
+ // skip hMF & rcWinMF
+ // set dxaGoal & dyaGoal
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Width()));
+ Set_UInt16(pArr, msword_cast<sal_uInt16>(aGrTwipSz.Height()));
+
+ if( aGrTwipSz.Width() + nXSizeAdd ) // set mx
+ {
+ double fVal = nWidth * 1000.0 / (aGrTwipSz.Width() + nXSizeAdd);
+ Set_UInt16( pArr, (sal_uInt16)::rtl::math::round(fVal) );
+ }
+ else
+ pArr += 2;
+
+ if( aGrTwipSz.Height() + nYSizeAdd ) // set my
+ {
+ double fVal = nHeight * 1000.0 / (aGrTwipSz.Height() + nYSizeAdd);
+ Set_UInt16( pArr, (sal_uInt16)::rtl::math::round(fVal) );
+ }
+ else
+ pArr += 2;
+
+ Set_UInt16( pArr, nCropL ); // set dxaCropLeft
+ Set_UInt16( pArr, nCropT ); // set dyaCropTop
+ Set_UInt16( pArr, nCropR ); // set dxaCropRight
+ Set_UInt16( pArr, nCropB ); // set dyaCropBottom
+
+ rStrm.Write( aArr, nHdrLen );
+}
+void SwWW8WrGrf::WriteGrfForBullet(SvStream& rStrm, const Graphic &rGrf, sal_uInt16 nWidth, sal_uInt16 nHeight)
+{
+ if (rWrt.bWrtWW8)
+ {
+ WritePICBulletFHeader(rStrm,rGrf, 0x64,nWidth,nHeight);
+ SwBasicEscherEx aInlineEscher(&rStrm, rWrt);
+ aInlineEscher.WriteGrfBullet(rGrf);
+ aInlineEscher.WritePictures();
+ }
+ else
+ {
+ /* bool bSwapped = rGrf.IsSwapOut() ? true : false; */
+
+ GDIMetaFile aMeta;
+ switch (rGrf.GetType())
+ {
+ case GRAPHIC_BITMAP: // Bitmap -> in Metafile abspielen
+ {
+ VirtualDevice aVirt;
+ aMeta.Record(&aVirt);
+ aVirt.DrawBitmap( Point( 0,0 ), rGrf.GetBitmap() );
+ aMeta.Stop();
+ aMeta.WindStart();
+ aMeta.SetPrefMapMode( rGrf.GetPrefMapMode());
+ aMeta.SetPrefSize( rGrf.GetPrefSize());
+ }
+ break;
+ case GRAPHIC_GDIMETAFILE : // GDI ( =SV ) Metafile
+ aMeta = rGrf.GetGDIMetaFile();
+ break;
+ default:
+ return;
+ }
+ WritePICBulletFHeader(rStrm, rGrf, 8, nWidth, nHeight);
+ WriteWindowMetafileBits(rStrm, aMeta);
+ }
+}
void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
{
@@ -783,6 +912,17 @@ void SwWW8WrGrf::WriteGraphicNode(SvStre
WriteGrfFromGrfNode(rStrm, *pNd, rItem.maFly, nWidth, nHeight);
}
break;
+ //For i120928,add branch to export graphic of bullet
+ case sw::Frame::eBulletGrf:
+ {
+ if (rItem.maFly.HasGraphic())
+ {
+ const Graphic& rGrf = rItem.maFly.GetGraphic();
+ WriteGrfForBullet(rStrm, rGrf, nWidth, nHeight);
+ }
+ }
+ break;
+
case sw::Frame::eOle:
{
#ifdef OLE_PREVIEW_AS_EMF
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/ww8attributeoutput.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/ww8attributeoutput.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/ww8attributeoutput.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/ww8attributeoutput.hxx Sun Feb 3 13:23:59 2013
@@ -208,7 +208,8 @@ public:
sal_Int16 nIndentAt,
sal_Int16 nFirstLineIndex,
sal_Int16 nListTabPos,
- const String &rNumberingString );
+ const String &rNumberingString,
+ const SvxBrushItem* pBrush = 0); //For i120928,transfer graphic of bullet
protected:
/// Output frames - the implementation.
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/ww8graf.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/ww8graf.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/ww8graf.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/ww8graf.cxx Sun Feb 3 13:23:59 2013
@@ -99,6 +99,11 @@
#include <math.h>
+#include <fmturl.hxx>
+#include <svx/hlnkitem.hxx>
+#include <svl/whiter.hxx>
+#include "ww8par2.hxx"
+
using namespace ::com::sun::star;
using namespace sw::types;
using namespace sw::util;
@@ -2728,6 +2733,44 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLaye
if (pRecord->bHidden)
return 0;
+ if(pObject)
+ {
+ sal_uInt16 nCount = pObject->GetUserDataCount();
+ if(nCount)
+ {
+ String lnName, aObjName, aTarFrm;
+ for (sal_uInt16 i = 0; i < nCount; i++ )
+ {
+ SdrObjUserData* pData = pObject->GetUserData( i );
+ if( pData && pData->GetInventor() == SW_DRAWLAYER
+ && pData->GetId() == SW_UD_IMAPDATA)
+ {
+ SwMacroInfo* macInf = dynamic_cast<SwMacroInfo*>(pData);
+
+ if( macInf )// && macInf->GetShapeId() == pF->nSpId)
+ {
+ sal_Int32 nShapeId = macInf->GetShapeId();
+ if ( nShapeId == pF->nSpId )
+ {
+ lnName = macInf->GetHlink();
+ aObjName = macInf->GetName();
+ aTarFrm = macInf->GetTarFrm();
+ break;
+ }
+ }
+ }
+ }
+ SwFmtURL* pFmtURL = new SwFmtURL();
+ pFmtURL->SetURL( lnName, false );
+ if(aObjName.Len() > 0)
+ pFmtURL->SetName(aObjName);
+ if(aTarFrm.Len()>0)
+ pFmtURL->SetTargetFrameName(aTarFrm);
+ pFmtURL->SetMap(0);
+ aFlySet.Put(*pFmtURL);
+ }
+ }
+
// If we are to be "below text" then we are not to be opaque
// #i14045# MM If we are in a header or footer then make the object transparent
// Not exactly like word but close enough for now
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.cxx Sun Feb 3 13:23:59 2013
@@ -116,6 +116,12 @@
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
+#include "ndgrf.hxx"
+#include <editeng/brshitem.hxx>
+#include <editeng/editids.hrc>
+#include <txtflcnt.hxx>
+#include <fmtflcnt.hxx>
+#include <txatbase.hxx>
#include "ww8par2.hxx" // class WW8RStyle, class WW8AnchorPara
@@ -135,7 +141,7 @@
#include <iostream>
#include <dbgoutsw.hxx>
#endif
-
+#include <svx/hlnkitem.hxx>
#include "WW8Sttbf.hxx"
#include "WW8FibData.hxx"
#define MM_250 1417 // WW-Default fuer Hor. Seitenraender: 2.5 cm
@@ -146,6 +152,245 @@ using namespace sw::util;
using namespace sw::types;
using namespace nsHdFtFlags;
+#define VT_EMPTY 0
+#define VT_I4 3
+#define VT_LPSTR 30
+#define VT_LPWSTR 31
+#define VT_BLOB 65
+#define VT_TYPEMASK 0xFFF
+/** Expands to a pointer behind the last element of a STATIC data array (like STL end()). */
+#define STATIC_TABLE_END( array ) ((array)+STATIC_TABLE_SIZE(array))
+/** Expands to the size of a STATIC data array. */
+#define STATIC_TABLE_SIZE( array ) (sizeof(array)/sizeof(*(array)))
+
+SwMacroInfo* GetMacroInfo( SdrObject* pObj, sal_Bool bCreate ) // static
+{
+ if ( pObj )
+ {
+ sal_uInt16 nCount = pObj->GetUserDataCount();
+ for( sal_uInt16 i = 0; i < nCount; i++ )
+ {
+ SdrObjUserData* pData = pObj->GetUserData( i );
+ if( pData && pData->GetInventor() == SW_DRAWLAYER
+ && pData->GetId() == SW_UD_IMAPDATA)
+ return dynamic_cast<SwMacroInfo*>(pData);
+ }
+ if ( bCreate )
+ {
+ SwMacroInfo* pData = new SwMacroInfo;
+ pObj->InsertUserData( pData, 0 );
+ return pData;
+ }
+ }
+
+ return 0;
+};
+
+void lclGetAbsPath( String& rPath, sal_uInt16 nLevel, SwDocShell* pDocShell)
+{
+ String aTmpStr;
+ while( nLevel )
+ {
+ aTmpStr.AppendAscii( "../" );
+ --nLevel;
+ }
+ if(aTmpStr.Len())
+ aTmpStr += rPath;
+ else
+ aTmpStr = rPath;
+
+ if(aTmpStr.Len())
+ {
+ bool bWasAbs = false;
+ rPath = pDocShell->GetMedium()->GetURLObject().smartRel2Abs( aTmpStr, bWasAbs ).GetMainURL( INetURLObject::NO_DECODE );
+ // full path as stored in SvxURLField must be encoded
+ }
+}
+
+void lclIgnoreString32( SvMemoryStream& rStrm, bool b16Bit )
+{
+ sal_uInt32 nChars;
+ rStrm >> nChars;
+ if( b16Bit )
+ nChars *= 2;
+ rStrm.SeekRel( nChars );
+}
+
+String SwWW8ImplReader::ReadRawUniString( SvMemoryStream& rStrm,sal_uInt16 nChars, bool b16Bit )
+{
+ // Fixed-size characters
+ const sal_uInt8 WW8_NUL_C = '\x00'; /// NUL chararcter.
+ const sal_uInt16 WW8_NUL = WW8_NUL_C; /// NUL chararcter (unicode).
+ String aRet;
+ sal_Unicode mcNulSubst = '\0';
+
+ sal_uInt16 nCharsLeft = nChars;
+ sal_Unicode* pcBuffer = new sal_Unicode[ nCharsLeft + 1 ];
+
+ sal_Unicode* pcUniChar = pcBuffer;
+ sal_Unicode* pcEndChar = pcBuffer + nCharsLeft;
+
+ if( b16Bit )
+ {
+ sal_uInt16 nReadChar;
+ for( ; (pcUniChar < pcEndChar); ++pcUniChar )
+ {
+ rStrm >> (nReadChar);
+ (*pcUniChar) = (nReadChar == WW8_NUL) ? mcNulSubst : static_cast< sal_Unicode >( nReadChar );
+ }
+ }
+ else
+ {
+ sal_uInt8 nReadChar;
+ for( ; (pcUniChar < pcEndChar); ++pcUniChar )
+ {
+ rStrm >> nReadChar ;
+ (*pcUniChar) = (nReadChar == WW8_NUL_C) ? mcNulSubst : static_cast< sal_Unicode >( nReadChar );
+ }
+ }
+
+ *pcEndChar = '\0';
+ aRet.Append( pcBuffer );
+ delete[] pcBuffer;
+ return aRet;
+}
+
+void lclAppendString32( String& rString, SvMemoryStream& rStrm, sal_uInt32 nChars, bool b16Bit )
+{
+ sal_uInt16 nReadChars = ulimit_cast< sal_uInt16 >( nChars );
+ String urlStr = SwWW8ImplReader::ReadRawUniString( rStrm, nReadChars, b16Bit );
+ rString.Append( urlStr );
+}
+
+void lclAppendString32( String& rString, SvMemoryStream& rStrm, bool b16Bit )
+{
+ sal_uInt32 nValue;
+ rStrm >>( nValue );
+ lclAppendString32( rString, rStrm, nValue, b16Bit );
+}
+
+void SwWW8ImplReader::ReadEmbeddedData( SvMemoryStream& rStrm, SwDocShell* pDocShell, struct HyperLinksTable& hlStr)
+{
+ // (0x01B8) HLINK -------------------------------------------------------------
+ // const sal_uInt16 WW8_ID_HLINK = 0x01B8;
+ const sal_uInt32 WW8_HLINK_BODY = 0x00000001; /// Contains file link or URL.
+ const sal_uInt32 WW8_HLINK_ABS = 0x00000002; /// Absolute path.
+ const sal_uInt32 WW8_HLINK_DESCR = 0x00000014; /// Description.
+ const sal_uInt32 WW8_HLINK_MARK = 0x00000008; /// Text mark.
+ const sal_uInt32 WW8_HLINK_FRAME = 0x00000080; /// Target frame.
+ const sal_uInt32 WW8_HLINK_UNC = 0x00000100; /// UNC path.
+
+ // sal_uInt8 maGuidStdLink[ 16 ] ={
+ // 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B };
+
+ sal_uInt8 maGuidUrlMoniker[ 16 ] = {
+ 0xE0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE, 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B };
+
+ sal_uInt8 maGuidFileMoniker[ 16 ] = {
+ 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 };
+
+ sal_uInt8* aGuid = new sal_uInt8[ 16 ];
+ sal_uInt32 nFlags;
+
+
+ rStrm.Read( aGuid, 16);
+ rStrm.SeekRel( 4 );
+ rStrm >> nFlags;
+
+ sal_uInt16 nLevel = 0; // counter for level to climb down in path
+ ::std::auto_ptr< String > xLongName; // link / file name
+ ::std::auto_ptr< String > xShortName; // 8.3-representation of file name
+ ::std::auto_ptr< String > xTextMark; // text mark
+
+ // description (ignore)
+ if( ::get_flag( nFlags, WW8_HLINK_DESCR ) )
+ lclIgnoreString32( rStrm, true );
+
+ // target frame
+ if( ::get_flag( nFlags, WW8_HLINK_FRAME ) )
+ {
+ ::std::auto_ptr< String > FrmName;
+ FrmName.reset( new String );
+ lclAppendString32(*FrmName , rStrm , true);
+ hlStr.tarFrm = *FrmName;
+ }
+
+ // UNC path
+ if( ::get_flag( nFlags, WW8_HLINK_UNC ) )
+ {
+ xLongName.reset( new String );
+ lclAppendString32( *xLongName, rStrm, true );
+ lclGetAbsPath( *xLongName, 0 , pDocShell);
+ }
+ // file link or URL
+ else if( ::get_flag( nFlags, WW8_HLINK_BODY ) )
+ {
+ rStrm.Read( aGuid, 16);
+
+ if( (memcmp(aGuid, maGuidFileMoniker, 16) == 0) )
+ {
+ rStrm >> nLevel;
+ xShortName.reset( new String );
+ lclAppendString32( *xShortName,rStrm, false );
+ rStrm.SeekRel( 24 );
+
+ sal_uInt32 nStrLen;
+ rStrm >> nStrLen;
+ if( nStrLen )
+ {
+ rStrm >> nStrLen;
+ nStrLen /= 2;
+ rStrm.SeekRel( 2 );
+ xLongName.reset( new String );
+ lclAppendString32( *xLongName, rStrm,nStrLen, true );
+ lclGetAbsPath( *xLongName, nLevel, pDocShell);
+ }
+ else
+ lclGetAbsPath( *xShortName, nLevel, pDocShell);
+ }
+ else if( (memcmp(aGuid, maGuidUrlMoniker, 16) == 0) )
+ {
+ sal_uInt32 nStrLen;
+ rStrm >> nStrLen;
+ nStrLen /= 2;
+ xLongName.reset( new String );
+ lclAppendString32( *xLongName,rStrm, nStrLen, true );
+ if( !::get_flag( nFlags, WW8_HLINK_ABS ) )
+ lclGetAbsPath( *xLongName, 0 ,pDocShell);
+ }
+ else
+ {
+ DBG_ERRORFILE( "WW8Hyperlink::ReadEmbeddedData - unknown content GUID" );
+ }
+ }
+
+ // text mark
+ if( ::get_flag( nFlags, WW8_HLINK_MARK ) )
+ {
+ xTextMark.reset( new String );
+ lclAppendString32( *xTextMark, rStrm, true );
+ }
+
+ if( !xLongName.get() && xShortName.get() )
+ {
+ xLongName.reset( new String );
+ xLongName->Append(*xShortName);
+ }
+ else if( !xLongName.get() && xTextMark.get() )
+ xLongName.reset( new String );
+
+ if( xLongName.get() )
+ {
+ if( xTextMark.get() )
+ {
+ if( xLongName->Len() == 0 )
+ xTextMark->SearchAndReplaceAll( '!', '.' );
+ xLongName->Append( '#' );
+ xLongName->Append( *xTextMark );
+ }
+ hlStr.hLinkAddr = *xLongName;
+ }
+}
SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr )
: SvxMSDffManager(*rRdr.pTableStream, rRdr.GetBaseURL(), rRdr.pWwFib->fcDggInfo,
@@ -746,6 +991,51 @@ SdrObject* SwMSDffManager::ProcessObj(Sv
delete pImpRec;
}
+ sal_uInt32 nBufferSize = GetPropertyValue( DFF_Prop_pihlShape );
+ if( (0 < nBufferSize) && (nBufferSize <= 0xFFFF) && SeekToContent( DFF_Prop_pihlShape, rSt ) )
+ {
+ SvMemoryStream aMemStream;
+ String aStrURL;
+ struct HyperLinksTable hlStr;
+ sal_uInt16 mnRawRecId,mnRawRecSize;
+ aMemStream << sal_uInt16( 0 ) << static_cast< sal_uInt16 >( nBufferSize );
+
+ // copy from DFF stream to memory stream
+ ::std::vector< sal_uInt8 > aBuffer( nBufferSize );
+ sal_uInt8* pnData = &aBuffer.front();
+ sal_uInt8 mnStreamSize;
+ if( pnData && rSt.Read( pnData, nBufferSize ) == nBufferSize )
+ {
+ aMemStream.Write( pnData, nBufferSize );
+ aMemStream.Seek( STREAM_SEEK_TO_END );
+ mnStreamSize = aMemStream.Tell();
+ aMemStream.Seek( STREAM_SEEK_TO_BEGIN );
+ bool bRet = 4 <= mnStreamSize;
+ if( bRet )
+ aMemStream >> mnRawRecId >> mnRawRecSize;
+ SwDocShell* pDocShell = rReader.mpDocShell;
+ if(pDocShell)
+ {
+ rReader.ReadEmbeddedData( aMemStream, pDocShell, hlStr);
+ }
+ }
+
+ if(pObj && hlStr.hLinkAddr.Len() > 0)
+ {
+ SwMacroInfo* pInfo = GetMacroInfo( pObj, true );
+ if( pInfo )
+ {
+ pInfo->SetShapeId( rObjData.nShapeId );
+ pInfo->SetHlink( hlStr.hLinkAddr );
+ if(hlStr.tarFrm.Len() > 0)
+ pInfo->SetTarFrm( hlStr.tarFrm );
+ String aNameStr = GetPropertyString( DFF_Prop_wzName, rSt );
+ if(aNameStr.Len() > 0)
+ pInfo->SetName( aNameStr );
+ }
+ }
+ }
+
return pObj;
}
@@ -4365,7 +4655,8 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8G
GrafikDtor();
DELETEZ( pMSDffManager );
DELETEZ( pHdFt );
- DELETEZ( pLstManager );
+ //For i120928,delay the destruct action
+ //DELETEZ( pLstManager );
DELETEZ( pSBase );
delete pWDop;
DELETEZ( pFonts );
@@ -4382,7 +4673,87 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8G
delete mpRedlineStack;
DeleteAnchorStk();
DeleteRefStks();
-
+ //For i120928,achieve the graphics from the special bookmark with is for graphic bullet
+ {
+ std::vector<const SwGrfNode*> vecBulletGrf;
+ std::vector<SwFrmFmt*> vecFrmFmt;
+
+ IDocumentMarkAccess* const pMarkAccess =
+ rDoc.getIDocumentMarkAccess();
+ if ( pMarkAccess )
+ {
+ IDocumentMarkAccess::const_iterator_t ppBkmk =
+ pMarkAccess->findBookmark( C2U("_PictureBullets") );
+ //for(IDocumentMarkAccess::const_iterator_t ppBookmark = ppBkmk->begin();
+ // ppBookmark != ppBkmk->end(); ppBookmark++)
+ if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
+ IDocumentMarkAccess::GetType( *(ppBkmk->get()) )
+ == IDocumentMarkAccess::BOOKMARK )
+ {
+ SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode();
+ if ( pTxtNode )
+ {
+ const SwpHints *pHints = pTxtNode->GetpSwpHints();
+ for(int nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos)
+ {
+ const SwTxtAttr *pHt = (*pHints)[nHintPos];
+ xub_StrLen st = *(pHt->GetStart());
+ if(pHt && pHt->Which() == RES_TXTATR_FLYCNT && (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex()))
+ {
+ SwFrmFmt *pFrmFmt = pHt->GetFlyCnt().GetFrmFmt();
+ const SwNodeIndex *pNdIdx = pFrmFmt->GetCntnt().GetCntntIdx();
+ const SwNodes &nos = pNdIdx->GetNodes();
+ const SwGrfNode *pGrf = dynamic_cast<const SwGrfNode*>(nos[pNdIdx->GetIndex() + 1]);
+ if (pGrf)
+ {
+ vecBulletGrf.push_back(pGrf);
+ vecFrmFmt.push_back(pFrmFmt);
+ }
+ }
+ }
+ // update graphic bullet information
+ sal_uInt16 nCount = pLstManager->GetWW8LSTInfoNum();
+ for (sal_uInt16 i = 0; i < nCount; ++i)
+ {
+ SwNumRule* pRule = pLstManager->GetNumRule(i);
+ for (sal_uInt16 j = 0; j < MAXLEVEL; ++j)
+ {
+ SwNumFmt aNumFmt(pRule->Get(j));
+ sal_Int16 nType = aNumFmt.GetNumberingType();
+ sal_uInt16 nGrfBulletCP = aNumFmt.GetGrfBulletCP();
+ if (nType == SVX_NUM_BITMAP && vecBulletGrf.size() > nGrfBulletCP)
+ {
+ Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf();
+ SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH);
+ Font aFont = numfunc::GetDefBulletFont();
+ int nHeight = aFont.GetHeight() * 12;//20;
+ Size aPrefSize( aGraphic.GetPrefSize());
+ if (aPrefSize.Height() * aPrefSize.Width() != 0 )
+ {
+ int nWidth = (nHeight * aPrefSize.Width()) / aPrefSize.Height();
+ Size aSize(nWidth, nHeight);
+ aNumFmt.SetGraphicBrush(&aBrush, &aSize);
+ }
+ else
+ {
+ aNumFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ aNumFmt.SetBulletChar(0x2190);
+ }
+ pRule->Set( j, aNumFmt );
+ }
+ }
+ }
+ // Remove additional pictures
+ for (sal_uInt16 i = 0; i < vecFrmFmt.size(); ++i)
+ {
+ rDoc.DelLayoutFmt(vecFrmFmt[i]);
+ }
+ }
+ }
+ DELETEZ( pLstManager );
+ }
+ }
+
UpdateFields();
// delete the pam before the call for hide all redlines (Bug 73683)
@@ -5337,3 +5708,20 @@ namespace sw
}
/* vi:set tabstop=4 shiftwidth=4 expandtab: */
+
+SwMacroInfo::SwMacroInfo() :
+ SdrObjUserData( SW_DRAWLAYER, SW_UD_IMAPDATA, 0 )
+{
+}
+
+SwMacroInfo::~SwMacroInfo()
+{
+}
+
+SdrObjUserData* SwMacroInfo::Clone( SdrObject* /*pObj*/ ) const
+{
+ return new SwMacroInfo( *this );
+}
+
+
+
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par.hxx Sun Feb 3 13:23:59 2013
@@ -31,11 +31,16 @@
#include <editeng/frmdir.hxx>
#include <fltshell.hxx> // fuer den Attribut Stack
+#include <svx/svdobj.hxx>
+#define SW_DRAWLAYER 0x30334353
+#define SW_UD_IMAPDATA 2
+
#include <vector>
#include <stack>
#include <deque>
#include <map>
#include <utility>
+#include <limits>
#include "tracer.hxx"
#include "ww8struc.hxx" // WW8_BRC
@@ -186,6 +191,8 @@ public:
std::vector<sal_uInt8> &rParaSprms, SwTxtNode *pNode=0);
SwNumRule* CreateNextRule(bool bSimple);
~WW8ListManager();
+ SwNumRule* GetNumRule(sal_uInt16 i);
+ sal_uInt16 GetWW8LSTInfoNum() const{return static_cast< sal_uInt16 >(maLSTInfos.size());}
private:
wwSprmParser maSprmParser;
SwWW8ImplReader& rReader;
@@ -363,6 +370,48 @@ private:
SwWW8FltRefStack& operator=(const SwWW8FltRefStack&);
};
+template< typename Type >
+inline bool get_flag( Type nBitField, Type nMask )
+{ return (nBitField & nMask) != 0; }
+
+template< typename ReturnType, typename Type >
+inline ReturnType ulimit_cast( Type nValue, ReturnType nMax )
+{ return static_cast< ReturnType >( ::std::min< Type >( nValue, nMax ) ); }
+
+
+template< typename ReturnType, typename Type >
+inline ReturnType ulimit_cast( Type nValue )
+{ return ulimit_cast( nValue, ::std::numeric_limits< ReturnType >::max() ); }
+
+class SwMacroInfo : public SdrObjUserData
+{
+public:
+ SwMacroInfo();
+ virtual ~SwMacroInfo();
+
+ virtual SdrObjUserData* Clone( SdrObject* pObj ) const;
+
+
+ void SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; }
+ const rtl::OUString& GetHlink() const { return maHlink; }
+ void SetTarFrm( const rtl::OUString& rTarFrm ) { maTarFrm = rTarFrm; }
+ const rtl::OUString& GetTarFrm() const { return maTarFrm; }
+ void SetShapeId( const sal_uInt32& rShapeId ) { maShapeId = rShapeId; }
+ const sal_uInt32& GetShapeId() const { return maShapeId; }
+ void SetName( const rtl::OUString& rName ) { maNameStr = rName; }
+ const rtl::OUString& GetName() const { return maNameStr; }
+
+private:
+ sal_uInt32 maShapeId;
+ rtl::OUString maHlink;
+ rtl::OUString maNameStr;
+ rtl::OUString maTarFrm;
+};
+struct HyperLinksTable
+{
+ String hLinkAddr;
+ String tarFrm;
+};
namespace sw
{
@@ -1665,6 +1714,8 @@ public: // eigentlich private, geht
CharSet GetCurrentCJKCharSet();
void PostProcessAttrs();
+ static void ReadEmbeddedData(SvMemoryStream& rStrm, SwDocShell* pDocShell ,struct HyperLinksTable& hlStr);
+ static String ReadRawUniString( SvMemoryStream& rStrm,sal_uInt16 nChars, bool b16Bit );
};
bool CanUseRemoteLink(const String &rGrfName);
Modified: openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par3.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par3.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par3.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/filter/ww8/ww8par3.cxx Sun Feb 3 13:23:59 2013
@@ -530,6 +530,9 @@ bool WW8ListManager::ReadLVL(SwNumFmt& r
SvxExtNumType eType; // Writer-Num-Typ
SvxAdjust eAdj; // Ausrichtung (Links/rechts/zent.)
sal_Unicode cBullet(0x2190); // default safe bullet
+
+ sal_Unicode cGrfBulletCP(USHRT_MAX);
+
String sPrefix;
String sPostfix;
WW8LVL aLVL;
@@ -673,12 +676,28 @@ bool WW8ListManager::ReadLVL(SwNumFmt& r
//
// 3. ggfs. CHPx einlesen und
//
+ sal_uInt16 nWitchPicIsBullet = USHRT_MAX;
+ bool bIsPicBullet = false;
+
if( aLVL.nLenGrpprlChpx )
{
sal_uInt8 aGrpprlChpx[ 255 ];
memset(&aGrpprlChpx, 0, sizeof( aGrpprlChpx ));
if(aLVL.nLenGrpprlChpx != rSt.Read(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
return false;
+
+ //For i120928,parse the graphic info of bullets
+ sal_uInt8 *pSprmWhichPis = GrpprlHasSprm(0x6887,aGrpprlChpx[0],aLVL.nLenGrpprlChpx);
+ sal_uInt8 *pSprmIsPicBullet = GrpprlHasSprm(0x4888,aGrpprlChpx[0],aLVL.nLenGrpprlChpx);
+ if (pSprmWhichPis)
+ {
+ nWitchPicIsBullet = *pSprmWhichPis;
+ }
+ if (pSprmIsPicBullet)
+ {
+ bIsPicBullet = (*pSprmIsPicBullet) & 0x0001;
+ }
+
// neues ItemSet fuer die Zeichenattribute anlegen
rpItemSet = new SfxItemSet( rDoc.GetAttrPool(), RES_CHRATR_BEGIN,
RES_CHRATR_END - 1 );
@@ -747,6 +766,12 @@ bool WW8ListManager::ReadLVL(SwNumFmt& r
case 23:
case 25: //#114412#
eType = SVX_NUM_CHAR_SPECIAL;
+ //For i120928,type info
+ if (bIsPicBullet)
+ {
+ eType = SVX_NUM_BITMAP;
+ }
+
break;
case 255:
eType = SVX_NUM_NUMBER_NONE;
@@ -820,8 +845,10 @@ bool WW8ListManager::ReadLVL(SwNumFmt& r
if (!cBullet) // unsave control code?
cBullet = 0x2190;
- }
- else
+ } else if (SVX_NUM_BITMAP == eType) //For i120928,position index info of graphic
+ {
+ cGrfBulletCP = nWitchPicIsBullet; // This is a bullet picture ID
+ } else
{
/*
#83154#, #82192#, #i173#, #109158#
@@ -891,6 +918,11 @@ bool WW8ListManager::ReadLVL(SwNumFmt& r
// Don't forget: unten, nach dem Bauen eventueller Styles auch noch
// SetBulletFont() rufen !!!
}
+ //For i120928,position index info
+ else if (SVX_NUM_BITMAP == eType)
+ {
+ rNumFmt.SetGrfBulletCP(cGrfBulletCP);
+ }
else
{
// reminder: Garnix ist default Prefix
@@ -1088,6 +1120,14 @@ SwNumRule* WW8ListManager::CreateNextRul
return pMyNumRule;
}
+SwNumRule* WW8ListManager::GetNumRule(sal_uInt16 i)
+{
+ if ( i < maLSTInfos.size() )
+ return maLSTInfos[i]->pNumRule;
+ else
+ return 0;
+}
+
// oeffentliche Methoden /////////////////////////////////////////////////////
//
WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
Modified: openoffice/branches/l10n/main/sw/source/ui/app/docshini.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/app/docshini.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/app/docshini.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/app/docshini.cxx Sun Feb 3 13:23:59 2013
@@ -347,8 +347,6 @@ sal_Bool SwDocShell::InitNew( const uno:
//#i16874# AutoKerning as default for new documents
pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );
- pDoc->SetDrawDefaults();
-
// --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)>
// at the document instance, the document is modified. Thus, reset this
// status here. Note: In method <SubInitNew()> this is also done.
Modified: openoffice/branches/l10n/main/sw/source/ui/config/usrpref.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/config/usrpref.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/config/usrpref.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/config/usrpref.cxx Sun Feb 3 13:23:59 2013
@@ -261,9 +261,10 @@ Sequence<OUString> SwLayoutViewConfig::G
"Window/IsVerticalRulerRight", //16
"ViewLayout/Columns", //17
"ViewLayout/BookMode", //18
- "Other/IsSquaredPageMode" //19
+ "Other/IsSquaredPageMode", //19
+ "Window/ShowScrollBarTips" //20
};
- const int nCount = bWeb ? 15 : 20;
+ const int nCount = bWeb ? 15 : 21;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -331,6 +332,7 @@ void SwLayoutViewConfig::Commit()
case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break; // "ViewLayout/Columns",
case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode",
case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode",
+ case 20: rVal <<= (sal_Bool) rParent.IsShowScrollBarTips(); break; // "Window/ShowScrollBarTips",
}
}
PutProperties(aNames, aValues);
@@ -387,6 +389,7 @@ void SwLayoutViewConfig::Load()
case 17: rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
case 18: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
case 19: rParent.SetDefaultPageMode(bSet,sal_True); break;// "Other/IsSquaredPageMode",
+ case 20: rParent.SetShowScrollBarTips(bSet); break;// "Window/ShowScrollBarTips",
}
}
}
Modified: openoffice/branches/l10n/main/sw/source/ui/config/viewopt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/config/viewopt.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/config/viewopt.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/config/viewopt.cxx Sun Feb 3 13:23:59 2013
@@ -223,14 +223,27 @@ SwViewOption::SwViewOption() :
{
// Initialisierung ist jetzt etwas einfacher
// alle Bits auf 0
- nCoreOptions = VIEWOPT_1_HARDBLANK | VIEWOPT_1_SOFTHYPH |
- VIEWOPT_1_REF |
- VIEWOPT_1_GRAPHIC |
- VIEWOPT_1_TABLE | VIEWOPT_1_DRAW | VIEWOPT_1_CONTROL |
- VIEWOPT_1_PAGEBACK |
- VIEWOPT_1_SOLIDMARKHDL | VIEWOPT_1_POSTITS;
- nCore2Options = VIEWOPT_CORE2_BLACKFONT | VIEWOPT_CORE2_HIDDENPARA;
- nUIOptions = VIEWOPT_2_MODIFIED | VIEWOPT_2_GRFKEEPZOOM |VIEWOPT_2_ANY_RULER;
+ nCoreOptions =
+ VIEWOPT_1_HARDBLANK |
+ VIEWOPT_1_SOFTHYPH |
+ VIEWOPT_1_REF |
+ VIEWOPT_1_GRAPHIC |
+ VIEWOPT_1_TABLE |
+ VIEWOPT_1_DRAW |
+ VIEWOPT_1_CONTROL |
+ VIEWOPT_1_PAGEBACK |
+ VIEWOPT_1_SOLIDMARKHDL | // default is enhanced handles
+ VIEWOPT_1_POSTITS;
+
+ nCore2Options =
+ VIEWOPT_CORE2_BLACKFONT |
+ VIEWOPT_CORE2_HIDDENPARA |
+ VIEWOPT_CORE2_BIGMARKHDL; // default is big handles
+
+ nUIOptions =
+ VIEWOPT_2_MODIFIED |
+ VIEWOPT_2_GRFKEEPZOOM |
+ VIEWOPT_2_ANY_RULER;
if(MEASURE_METRIC != SvtSysLocale().GetLocaleData().getMeasurementSystemEnum())
aSnapSize.Width() = aSnapSize.Height() = 720; // 1/2"
Modified: openoffice/branches/l10n/main/sw/source/ui/dochdl/swdtflvr.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/dochdl/swdtflvr.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/dochdl/swdtflvr.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/dochdl/swdtflvr.cxx Sun Feb 3 13:23:59 2013
@@ -397,8 +397,13 @@ sal_Bool SwTransferable::GetData( const
{
SelectionType nSelectionType = pWrtShell->GetSelectionType();
-// SEL_GRF kommt vom ContentType der editsh
- if( (nsSelectionType::SEL_GRF | nsSelectionType::SEL_DRW_FORM) & nSelectionType )
+ // when pending we will not get the correct type, but nsSelectionType::SEL_TXT
+ // as fallback. This *happens* durning D&D, so we need to check if we are in
+ // the fallback and just try to get a graphic
+ const bool bPending(pWrtShell->BasicActionPend());
+
+ // SEL_GRF kommt vom ContentType der editsh
+ if(bPending || ((nsSelectionType::SEL_GRF | nsSelectionType::SEL_DRW_FORM) & nSelectionType))
{
pClpGraphic = new Graphic;
if( !pWrtShell->GetDrawObjGraphic( FORMAT_GDIMETAFILE, *pClpGraphic ))
@@ -540,11 +545,10 @@ sal_Bool SwTransferable::GetData( const
bOK = SetGDIMetaFile( pClpGraphic->GetGDIMetaFile(), rFlavor );
break;
case SOT_FORMAT_BITMAP:
+ case SOT_FORMATSTR_ID_PNG:
// #126398# Neither pClpBitmap nor pClpGraphic are necessarily set
if( (eBufferType & TRNSFR_GRAPHIC) && (pClpBitmap != 0 || pClpGraphic != 0))
- bOK = SetBitmap( (pClpBitmap ? pClpBitmap
- : pClpGraphic)->GetBitmap(),
- rFlavor );
+ bOK = SetBitmapEx( (pClpBitmap ? pClpBitmap : pClpGraphic)->GetBitmapEx(), rFlavor );
break;
case SOT_FORMATSTR_ID_SVIM:
@@ -794,6 +798,7 @@ int SwTransferable::PrepareForCopy( sal_
// <--
{
AddFormat( FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( FORMAT_BITMAP );
}
eBufferType = TRNSFR_GRAPHIC;
@@ -900,6 +905,7 @@ int SwTransferable::PrepareForCopy( sal_
if ( nSelection & nsSelectionType::SEL_DRW )
{
AddFormat( FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( FORMAT_BITMAP );
}
eBufferType = (TransferBufferType)( TRNSFR_GRAPHIC | eBufferType );
@@ -1229,8 +1235,31 @@ int SwTransferable::PasteData( Transfera
// pTunneledTrans = (SwTransferable*) (sal_IntPtr) nHandle;
// }
- if( pPt && ( bPasteSelection ? 0 != ( pTrans = pMod->pXSelection )
- : 0 != ( pTrans = pMod->pDragDrop) ))
+ // check for private drop
+ bool bPrivateDrop(pPt && (bPasteSelection ? 0 != (pTrans = pMod->pXSelection) : 0 != (pTrans = pMod->pDragDrop)));
+ bool bNeedToSelectBeforePaste(false);
+
+ if(bPrivateDrop && DND_ACTION_LINK == nDropAction)
+ {
+ // internal drop on object, suppress bPrivateDrop to change internal fill
+ bPrivateDrop = false;
+ bNeedToSelectBeforePaste = true;
+ }
+
+ if(bPrivateDrop && pPt && DND_ACTION_MOVE == nDropAction)
+ {
+ // check if dragged over a useful target. If yes, use as content exchange
+ // drop as if from external
+ const SwFrmFmt* pSwFrmFmt = rSh.GetFmtFromObj(*pPt);
+
+ if(pSwFrmFmt && 0 != dynamic_cast< const SwDrawFrmFmt* >(pSwFrmFmt))
+ {
+ bPrivateDrop = false;
+ bNeedToSelectBeforePaste = true;
+ }
+ }
+
+ if(bPrivateDrop)
{
// then internal Drag & Drop or XSelection
nRet = pTrans->PrivateDrop( rSh, *pPt, DND_ACTION_MOVE == nDropAction,
@@ -1282,7 +1311,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case SOT_FORMATSTR_ID_DRAWING:
nRet = SwTransferable::_PasteSdrFormat( rData, rSh,
SW_PASTESDR_INSERT, pPt,
- nActionFlags );
+ nActionFlags, bNeedToSelectBeforePaste);
break;
case SOT_FORMATSTR_ID_HTML:
@@ -1320,7 +1349,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case SOT_FORMAT_GDIMETAFILE:
nRet = SwTransferable::_PasteGrf( rData, rSh, nFormat,
SW_PASTESDR_INSERT,pPt,
- nActionFlags, bMsg );
+ nActionFlags, nDropAction, bNeedToSelectBeforePaste);
break;
case SOT_FORMATSTR_ID_XFORMS:
@@ -1440,7 +1469,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case SOT_FORMATSTR_ID_DRAWING:
nRet = SwTransferable::_PasteSdrFormat( rData, rSh,
SW_PASTESDR_SETATTR, pPt,
- nActionFlags );
+ nActionFlags, bNeedToSelectBeforePaste);
break;
case SOT_FORMATSTR_ID_SVXB:
case SOT_FORMAT_GDIMETAFILE:
@@ -1451,7 +1480,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR:
nRet = SwTransferable::_PasteGrf( rData, rSh, nFormat,
SW_PASTESDR_SETATTR, pPt,
- nActionFlags, bMsg );
+ nActionFlags, nDropAction, bNeedToSelectBeforePaste);
break;
default:
ASSERT( sal_False, "unbekanntes Format" );
@@ -1462,7 +1491,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case EXCHG_OUT_ACTION_INSERT_DRAWOBJ:
nRet = SwTransferable::_PasteSdrFormat( rData, rSh,
SW_PASTESDR_INSERT, pPt,
- nActionFlags );
+ nActionFlags, bNeedToSelectBeforePaste);
break;
case EXCHG_OUT_ACTION_INSERT_SVXB:
case EXCHG_OUT_ACTION_INSERT_GDIMETAFILE:
@@ -1470,13 +1499,13 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case EXCHG_OUT_ACTION_INSERT_GRAPH:
nRet = SwTransferable::_PasteGrf( rData, rSh, nFormat,
SW_PASTESDR_INSERT, pPt,
- nActionFlags, bMsg );
+ nActionFlags, nDropAction, bNeedToSelectBeforePaste);
break;
case EXCHG_OUT_ACTION_REPLACE_DRAWOBJ:
nRet = SwTransferable::_PasteSdrFormat( rData, rSh,
SW_PASTESDR_REPLACE, pPt,
- nActionFlags );
+ nActionFlags, bNeedToSelectBeforePaste);
break;
case EXCHG_OUT_ACTION_REPLACE_SVXB:
@@ -1485,7 +1514,7 @@ ASSERT( pPt, "EXCHG_OUT_ACTION_MOVE_PRIV
case EXCHG_OUT_ACTION_REPLACE_GRAPH:
nRet = SwTransferable::_PasteGrf( rData, rSh, nFormat,
SW_PASTESDR_REPLACE,pPt,
- nActionFlags, bMsg );
+ nActionFlags, nDropAction, bNeedToSelectBeforePaste);
break;
case EXCHG_OUT_ACTION_INSERT_INTERACTIVE:
@@ -2211,13 +2240,21 @@ int SwTransferable::_PasteDDE( Transfera
int SwTransferable::_PasteSdrFormat( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uInt16 nAction,
- const Point* pPt, sal_uInt8 nActionFlags )
+ const Point* pPt, sal_uInt8 nActionFlags, bool bNeedToSelectBeforePaste)
{
int nRet = 0;
SotStorageStreamRef xStrm;
if( rData.GetSotStorageStream( SOT_FORMATSTR_ID_DRAWING, xStrm ))
{
xStrm->SetVersion( SOFFICE_FILEFORMAT_50 );
+
+ if(bNeedToSelectBeforePaste && pPt)
+ {
+ // if this is an internal drag, need to set the target right (select it), else
+ // still the source will be selected
+ SwTransferable::SetSelInShell( rSh, sal_True, pPt );
+ }
+
rSh.Paste( *xStrm, nAction, pPt );
nRet = 1;
@@ -2232,7 +2269,7 @@ int SwTransferable::_PasteSdrFormat( Tr
int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
sal_uLong nFmt, sal_uInt16 nAction, const Point* pPt,
- sal_uInt8 nActionFlags, sal_Bool /*bMsg*/ )
+ sal_uInt8 nActionFlags, sal_Int8 /* nDropAction */, bool bNeedToSelectBeforePaste)
{
int nRet = 0;
@@ -2247,6 +2284,19 @@ int SwTransferable::_PasteGrf( Transfera
nRet = rData.GetGraphic( nFmt, aGrf );
break;
+ case SOT_FORMATSTR_ID_SVXB:
+ {
+ SotStorageStreamRef xStm;
+
+ if(rData.GetSotStorageStream(SOT_FORMATSTR_ID_SVXB, xStm))
+ {
+ *xStm >> aGrf;
+ nRet = (GRAPHIC_NONE != aGrf.GetType() && GRAPHIC_DEFAULT != aGrf.GetType());
+ }
+
+ break;
+ }
+
case SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK:
case SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR:
case SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR:
@@ -2306,6 +2356,15 @@ int SwTransferable::_PasteGrf( Transfera
}
}
+ if(pPt && bNeedToSelectBeforePaste)
+ {
+ // when using internal D&Ds, still the source object is selected and
+ // this is necessary to get the correct source data which is also
+ // dependent from selection. After receiving the drag data it is
+ // now tiime to select the correct target object
+ SwTransferable::SetSelInShell( rSh, sal_True, pPt );
+ }
+
if( nRet )
{
String sURL;
@@ -2474,10 +2533,10 @@ int SwTransferable::_PasteAsHyperlink( T
int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uLong nFmt,
sal_uInt16 nAction, const Point* pPt,
- sal_uInt8 nActionFlags, sal_Bool bMsg )
+ sal_uInt8 nActionFlags, sal_Bool /* bMsg */)
{
int nRet = SwTransferable::_PasteGrf( rData, rSh, nFmt, nAction,
- pPt, nActionFlags, bMsg );
+ pPt, nActionFlags, 0, false);
if( nRet )
nRet |= SWTRANSFER_GRAPHIC_INSERTED;
if( !nRet )
@@ -2990,6 +3049,7 @@ void SwTransferable::SetDataForDragAndDr
// <--
{
AddFormat( FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( FORMAT_BITMAP );
}
eBufferType = TRNSFR_GRAPHIC;
@@ -3039,6 +3099,7 @@ void SwTransferable::SetDataForDragAndDr
if ( nSelection & nsSelectionType::SEL_DRW )
{
AddFormat( FORMAT_GDIMETAFILE );
+ AddFormat( SOT_FORMATSTR_ID_PNG );
AddFormat( FORMAT_BITMAP );
}
eBufferType = (TransferBufferType)( TRNSFR_GRAPHIC | eBufferType );
Modified: openoffice/branches/l10n/main/sw/source/ui/docvw/edtwin.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/docvw/edtwin.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/docvw/edtwin.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/docvw/edtwin.cxx Sun Feb 3 13:23:59 2013
@@ -206,6 +206,7 @@ public:
void SetPos( const Point& rNew ) { pHdl->SetPos( rNew ); }
const Point& GetPos() { return pHdl->GetPos(); }
const Point& GetHdlPos() { return aHdlPos; }
+ SdrHdl* GetHdl() const { return pHdl; }
void ChgHdl( SdrHdl* pNew )
{
pHdl = pNew;
@@ -2881,6 +2882,8 @@ void SwEditWin::MouseButtonDown(const Mo
( pHdl->GetKind() == HDL_ANCHOR ||
pHdl->GetKind() == HDL_ANCHOR_TR ) )
{
+ // #121463# Set selected during drag
+ pHdl->SetSelected(true);
pAnchorMarker = new SwAnchorMarker( pHdl );
UpdatePointer( aDocPos, rMEvt.GetModifier() );
return;
@@ -4069,6 +4072,12 @@ void SwEditWin::MouseButtonUp(const Mous
if( pAnchorMarker )
{
+ if(pAnchorMarker->GetHdl())
+ {
+ // #121463# delete selected after drag
+ pAnchorMarker->GetHdl()->SetSelected(false);
+ }
+
Point aPnt( pAnchorMarker->GetLastPos() );
//OLMpSdrView->RefreshAllIAOManagers();
DELETEZ( pAnchorMarker );
Modified: openoffice/branches/l10n/main/sw/source/ui/envelp/labimp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/envelp/labimp.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/envelp/labimp.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/envelp/labimp.hxx Sun Feb 3 13:23:59 2013
@@ -71,7 +71,6 @@
#include <com/sun/star/awt/XComboBox.hpp>
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/MessageBoxCommand.hpp>
#include <com/sun/star/awt/XLayoutConstrains.hpp>
#include <com/sun/star/awt/XProgressBar.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
Modified: openoffice/branches/l10n/main/sw/source/ui/inc/swdtflvr.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/inc/swdtflvr.hxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/inc/swdtflvr.hxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/inc/swdtflvr.hxx Sun Feb 3 13:23:59 2013
@@ -106,11 +106,11 @@ class SwTransferable : public Transferab
static int _PasteSdrFormat( TransferableDataHelper& rData,
SwWrtShell& rSh, sal_uInt16 nAction,
- const Point* pPt, sal_uInt8 nActionFlags );
+ const Point* pPt, sal_uInt8 nActionFlags, bool bNeedToSelectBeforePaste);
static int _PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
sal_uLong nFmt, sal_uInt16 nAction, const Point* pPt,
- sal_uInt8 nActionFlags, sal_Bool bMsg );
+ sal_uInt8 nActionFlags, sal_Int8 nDropAction, bool bNeedToSelectBeforePaste);
static int _PasteImageMap( TransferableDataHelper& rData,
SwWrtShell& rSh );
Modified: openoffice/branches/l10n/main/sw/source/ui/uiview/viewport.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/uiview/viewport.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/uiview/viewport.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/uiview/viewport.cxx Sun Feb 3 13:23:59 2013
@@ -717,51 +717,55 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollba
// so we dont must do it agin.
EndScrollHdl(pScrollbar);
- Point aPos( aVisArea.TopLeft() );
- lcl_GetPos(this, aPos, pScrollbar, IsDocumentBorder());
+ if ( Help::IsQuickHelpEnabled() &&
+ pWrtShell->GetViewOptions()->IsShowScrollBarTips())
+ {
+ Point aPos( aVisArea.TopLeft() );
+ lcl_GetPos(this, aPos, pScrollbar, IsDocumentBorder());
- sal_uInt16 nPhNum = 1;
- sal_uInt16 nVirtNum = 1;
+ sal_uInt16 nPhNum = 1;
+ sal_uInt16 nVirtNum = 1;
- String sDisplay;
- if(pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay ))
- {
- // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
- // so we dont must do it agin.
-// if(!GetViewFrame()->GetFrame().IsInPlace())
-// S F X_BINDINGS().Update(FN_STAT_PAGE);
+ String sDisplay;
+ if(pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay ))
+ {
+ // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE,
+ // so we dont must do it agin.
+ // if(!GetViewFrame()->GetFrame().IsInPlace())
+ // S F X_BINDINGS().Update(FN_STAT_PAGE);
+
+ //QuickHelp:
+ if( pWrtShell->GetPageCnt() > 1 )
+ {
+ if( !nPgNum || nPgNum != nPhNum )
+ {
+ Rectangle aRect;
+ aRect.Left() = pScrollbar->GetParent()->OutputToScreenPixel(
+ pScrollbar->GetPosPixel() ).X() -8;
+ aRect.Top() = pScrollbar->OutputToScreenPixel(
+ pScrollbar->GetPointerPosPixel() ).Y();
+ aRect.Right() = aRect.Left();
+ aRect.Bottom() = aRect.Top();
+
+ String sPageStr( GetPageStr( nPhNum, nVirtNum, sDisplay ));
+ SwContentAtPos aCnt( SwContentAtPos::SW_OUTLINE );
+ pWrtShell->GetContentAtPos( aPos, aCnt );
+ if( aCnt.sStr.Len() )
+ {
+ sPageStr += String::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM( " - " ));
+ sPageStr.Insert( aCnt.sStr, 0, 80 );
+ sPageStr.SearchAndReplaceAll( '\t', ' ' );
+ sPageStr.SearchAndReplaceAll( 0x0a, ' ' );
+ }
- //QuickHelp:
- if( pWrtShell->GetPageCnt() > 1 && Help::IsQuickHelpEnabled() )
- {
- if( !nPgNum || nPgNum != nPhNum )
- {
- Rectangle aRect;
- aRect.Left() = pScrollbar->GetParent()->OutputToScreenPixel(
- pScrollbar->GetPosPixel() ).X() -8;
- aRect.Top() = pScrollbar->OutputToScreenPixel(
- pScrollbar->GetPointerPosPixel() ).Y();
- aRect.Right() = aRect.Left();
- aRect.Bottom() = aRect.Top();
-
- String sPageStr( GetPageStr( nPhNum, nVirtNum, sDisplay ));
- SwContentAtPos aCnt( SwContentAtPos::SW_OUTLINE );
- pWrtShell->GetContentAtPos( aPos, aCnt );
- if( aCnt.sStr.Len() )
- {
- sPageStr += String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( " - " ));
- sPageStr.Insert( aCnt.sStr, 0, 80 );
- sPageStr.SearchAndReplaceAll( '\t', ' ' );
- sPageStr.SearchAndReplaceAll( 0x0a, ' ' );
+ Help::ShowQuickHelp( pScrollbar, aRect, sPageStr,
+ QUICKHELP_RIGHT|QUICKHELP_VCENTER);
}
-
- Help::ShowQuickHelp( pScrollbar, aRect, sPageStr,
- QUICKHELP_RIGHT|QUICKHELP_VCENTER);
- }
- nPgNum = nPhNum;
- }
- }
+ nPgNum = nPhNum;
+ }
+ }
+ }
}
else
EndScrollHdl(pScrollbar);
Modified: openoffice/branches/l10n/main/sw/source/ui/uno/unomod.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/uno/unomod.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/uno/unomod.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/uno/unomod.cxx Sun Feb 3 13:23:59 2013
@@ -100,7 +100,8 @@ enum SwViewSettingsPropertyHandles
HANDLE_VIEWSET_RASTER_SUBDIVISION_X,
HANDLE_VIEWSET_RASTER_SUBDIVISION_Y,
HANDLE_VIEWSET_HORI_RULER_METRIC,
- HANDLE_VIEWSET_VERT_RULER_METRIC
+ HANDLE_VIEWSET_VERT_RULER_METRIC,
+ HANDLE_VIEWSET_SCROLLBAR_TIPS
};
enum SwPrintSettingsPropertyHandles
{
@@ -155,6 +156,7 @@ static ChainablePropertySetInfo * lcl_cr
{ RTL_CONSTASCII_STRINGPARAM ( "ShowParaBreaks"), HANDLE_VIEWSET_PARA_BREAKS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
{ RTL_CONSTASCII_STRINGPARAM ( "ShowProtectedSpaces"), HANDLE_VIEWSET_PROTECTED_SPACES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
{ RTL_CONSTASCII_STRINGPARAM ( "ShowRulers"), HANDLE_VIEWSET_SHOW_RULER , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
+ { RTL_CONSTASCII_STRINGPARAM ( "ShowScrollBarTips"), HANDLE_VIEWSET_SCROLLBAR_TIPS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
{ RTL_CONSTASCII_STRINGPARAM ( "ShowSoftHyphens"), HANDLE_VIEWSET_SOFT_HYPHENS , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
{ RTL_CONSTASCII_STRINGPARAM ( "ShowSpaces"), HANDLE_VIEWSET_SPACES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
{ RTL_CONSTASCII_STRINGPARAM ( "ShowTableBoundaries"), HANDLE_VIEWSET_TABLE_BOUNDARIES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0},
@@ -689,6 +691,7 @@ void SwXViewSettings::_setSingleValue( c
case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : mpViewOption->SetShowContentTips(bVal); break;
case HANDLE_VIEWSET_IS_RASTER_VISIBLE : mpViewOption->SetGridVisible(bVal); break;
case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : mpViewOption->SetSnap(bVal); break;
+ case HANDLE_VIEWSET_SCROLLBAR_TIPS : mpViewOption->SetShowScrollBarTips(bVal); break;
case HANDLE_VIEWSET_RASTER_RESOLUTION_X :
{
sal_Int32 nTmp = 0;
@@ -920,6 +923,7 @@ void SwXViewSettings::_getSingleValue( c
case HANDLE_VIEWSET_SHOW_CONTENT_TIPS : bBoolVal = mpConstViewOption->IsShowContentTips(); break;
case HANDLE_VIEWSET_IS_RASTER_VISIBLE : bBoolVal = mpConstViewOption->IsGridVisible(); break;
case HANDLE_VIEWSET_IS_SNAP_TO_RASTER : bBoolVal = mpConstViewOption->IsSnap(); break;
+ case HANDLE_VIEWSET_SCROLLBAR_TIPS : bBoolVal = mpConstViewOption->IsShowScrollBarTips(); break;
case HANDLE_VIEWSET_RASTER_RESOLUTION_X :
bBool = sal_False;
rValue <<= (sal_Int32) TWIP_TO_MM100(mpConstViewOption->GetSnapSize().Width());
Modified: openoffice/branches/l10n/main/sw/source/ui/wrtsh/wrtsh1.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/sw/source/ui/wrtsh/wrtsh1.cxx?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/sw/source/ui/wrtsh/wrtsh1.cxx (original)
+++ openoffice/branches/l10n/main/sw/source/ui/wrtsh/wrtsh1.cxx Sun Feb 3 13:23:59 2013
@@ -303,8 +303,9 @@ void SwWrtShell::Insert( const String &r
DelRight();
// eingefuegte Grafik in eigenen Absatz, falls am Ende
// eines nichtleeren Absatzes
- if ( IsEndPara() && !IsSttPara() )
- SwFEShell::SplitNode();
+ //For i120928,avoid to split node
+ //if ( IsEndPara() && !IsSttPara() )
+ // SwFEShell::SplitNode();
EnterSelFrmMode();
Modified: openoffice/branches/l10n/main/swext/mediawiki/build.xml
URL: http://svn.apache.org/viewvc/openoffice/branches/l10n/main/swext/mediawiki/build.xml?rev=1441909&r1=1441908&r2=1441909&view=diff
==============================================================================
--- openoffice/branches/l10n/main/swext/mediawiki/build.xml (original)
+++ openoffice/branches/l10n/main/swext/mediawiki/build.xml Sun Feb 3 13:23:59 2013
@@ -72,7 +72,7 @@
<target name="compile" depends="init">
<javac debug="${debug}" debuglevel="lines,vars,source" destdir="${classes}" classpathref="classpath"
- source="${sourcelevel}" verbose="${verbose}">
+ source="${sourcelevel}" verbose="${verbose}" includeantruntime="false">
<src path="src"/>
</javac>
</target>