Re: CVS: commit msevior abiword-plugins/tools/abicollab/xp AbiCollab_Export.cpp AbiCollab_Import.cpp AbiCollab_Import.h

From: Dom Lachowicz <domlachowicz_at_yahoo.com>
Date: Fri Feb 24 2006 - 06:16:28 CET

Typo...

+ else if(sType == "reformaylayout")

--- cvs@abisource.com wrote:

>
> Update of
> /cvsroot/abiword-plugins/tools/abicollab/xp
> In directory
>
abiword.snt.utwente.nl:/tmp/cvs-serv32059/abicollab/xp
>
> Modified Files:
> AbiCollab_Export.cpp AbiCollab_Import.cpp
> AbiCollab_Import.h
> Log Message:
>
> Work to handle signals
>
>
> Index: AbiCollab_Import.cpp
>
===================================================================
> RCS file:
>
/cvsroot/abiword-plugins/tools/abicollab/xp/AbiCollab_Import.cpp,v
> retrieving revision 1.5
> retrieving revision 1.6
> diff -u -d -r1.5 -r1.6
> --- AbiCollab_Import.cpp 24 Feb 2006 04:17:32 -0000
> 1.5
> +++ AbiCollab_Import.cpp 24 Feb 2006 05:03:44 -0000
> 1.6
> @@ -139,6 +139,7 @@
> xmlTextReaderPtr reader;
> int ret;
> const xmlChar *name, *value;
> + bool isSig = false;
> reader = xmlReaderForMemory(sPacket.utf8_str(),
> strlen(sPacket.utf8_str()), 0, "UTF-8", 0);
> if (reader != NULL)
> {
> @@ -156,6 +157,12 @@
> UT_DEBUGMSG(("Ignoring populate
> ChangeRecord\n"));
> return true; // UNHANDLED
> }
> + if ((strcmp(reinterpret_cast<const
> char*>(name), "sig") == 0))
> + {
> + sType = (char
> *)xmlTextReaderGetAttribute(reader, (const xmlChar
> *) "type");
> + isSig = true;
> + break;
> + }
>
> if ((strcmp(reinterpret_cast<const
> char*>(name), "cr") == 0 ||
> strcmp(reinterpret_cast<const char*>(name),
> "pop") == 0) &&
> @@ -202,6 +209,12 @@
> // parsing was successful; now handle the data
>
> UT_DEBUGMSG(("Type: %s\n", sType.utf8_str()));
> + if(isSig)
> + {
> + UT_uint32 iSignal = getSignalType(sType);
> + m_pDoc->signalListeners(iSignal);
> + return true;
> + }
> bool b = getCRType(sType, cType);
> if(!b)
> {
> @@ -669,6 +682,44 @@
> return true;
> }
>
> +UT_uint32
> ABI_Collab_Import::getSignalType(UT_UTF8String &
> sType)
> +{
> + UT_uint32 iSignal = 0;
> + if(sType == "updatelayout")
> + {
> + iSignal = PD_SIGNAL_UPDATE_LAYOUT;
> + }
> + else if(sType == "reformaylayout")
> + {
> + iSignal = PD_SIGNAL_REFORMAT_LAYOUT;
> + }
> + else if(sType == "revmodechanged")
> + {
> + iSignal = PD_SIGNAL_REVISION_MODE_CHANGED;
> + }
> + else if(sType == "updatepropsrebuild")
> + {
> + iSignal =
> PD_SIGNAL_DOCPROPS_CHANGED_REBUILD;
> + }
> + else if(sType == "updatepropsnorebuild")
> + {
> + iSignal =
> PD_SIGNAL_DOCPROPS_CHANGED_NO_REBUILD;
> + }
> + else if(sType == "docnamechanged")
> + {
> + iSignal = PD_SIGNAL_DOCNAME_CHANGED;
> + }
> + else if(sType == "docdirtychanged")
> + {
> + iSignal = PD_SIGNAL_DOCDIRTY_CHANGED;
> + }
> + else if(sType == "updatelayout")
> + {
> + iSignal = PD_SIGNAL_UPDATE_LAYOUT;
> + }
> + return iSignal;
> +}
> +
> bool ABI_Collab_Import::getStruxType(UT_UTF8String
> & sInPacket,
> PTStruxType & struxType,
> UT_UTF8String & sAttributes,
>
> Index: AbiCollab_Export.cpp
>
===================================================================
> RCS file:
>
/cvsroot/abiword-plugins/tools/abicollab/xp/AbiCollab_Export.cpp,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -d -r1.3 -r1.4
> --- AbiCollab_Export.cpp 24 Feb 2006 04:17:32 -0000
> 1.3
> +++ AbiCollab_Export.cpp 24 Feb 2006 05:03:44 -0000
> 1.4
> @@ -692,6 +692,50 @@
> */
> bool ABI_Collab_Export::signal(UT_uint32 iSignal)
> {
> + if (m_bMasked)
> + return true;
> +
> + //
> + // Translate the signals to packets
> + //
> + UT_UTF8String sPacket;
> + sPacket.clear();
> + sPacket += "<sig type=\"";
> + switch (iSignal)
> + {
> + case PD_SIGNAL_UPDATE_LAYOUT:
> + sPacket += "updatelayout \"";
> + break;
> + case PD_SIGNAL_REFORMAT_LAYOUT:
> + sPacket += "reformatlayout \"";
> + break;
> + case PD_SIGNAL_REVISION_MODE_CHANGED:
> + sPacket += "revmodechanged \"";
> + sPacket += "/>";
> + m_pAbiCollab->push(sPacket);
> + sPacket.clear();
> + sPacket += "<sig type=\"";
> +
> + // fall through ...
> +
> + case PD_SIGNAL_DOCPROPS_CHANGED_REBUILD:
> + sPacket += "updatepropsrebuild \"";
> + break;
> + case PD_SIGNAL_DOCPROPS_CHANGED_NO_REBUILD:
> + sPacket += "updatepropsnorebuild \"";
> + break;
> + case PD_SIGNAL_DOCNAME_CHANGED:
> + sPacket += "docnamechanged \"";
> + break;
> + case PD_SIGNAL_DOCDIRTY_CHANGED:
> + sPacket += "docdirtychanged \"";
> + break;
> + default:
> + UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
> + break;
> + }
> + sPacket += "/>";
> + m_pAbiCollab->push(sPacket);
> UT_DEBUGMSG(("Export Signal %d \n",iSignal));
> return true;
> }
>
> Index: AbiCollab_Import.h
>
===================================================================
> RCS file:
>
/cvsroot/abiword-plugins/tools/abicollab/xp/AbiCollab_Import.h,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -u -d -r1.3 -r1.4
> --- AbiCollab_Import.h 24 Feb 2006 04:17:32 -0000
> 1.3
> +++ AbiCollab_Import.h 24 Feb 2006 05:03:44 -0000
> 1.4
> @@ -55,6 +55,7 @@
> UT_UTF8String& sAttributes, UT_UTF8String&
> sOutpacket);
>
> bool fillAttsFromString(const XML_Char***
> szAtts, const UT_UTF8String& sAtts);
> + UT_uint32 getSignalType(UT_UTF8String & sType);
> void _freeProps(const XML_Char *** pszProps);
>
> //! Document to import into
>
=== message truncated ===

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on Fri Feb 24 06:15:21 2006

This archive was generated by hypermail 2.1.8 : Fri Feb 24 2006 - 06:15:22 CET