Hey guys,
Whenever someone gets around to applying my last change, w.r.t. correct
image placement, use the patch found attached to this email instead of
the one that I sent in the tarball - that one was bogus. Thanks.
John
Index: abi/src/af/util/Makefile
===================================================================
RCS file: /cvsroot/abi/src/af/util/Makefile,v
retrieving revision 1.57
diff -u -3 -p -u -r1.57 Makefile
--- abi/src/af/util/Makefile 2001/08/10 18:32:38 1.57
+++ abi/src/af/util/Makefile 2001/08/17 00:57:17
@@ -108,7 +108,8 @@ OBJS= $(PLATFORM_OBJS)
\
$(OBJDIR)/ut_AdobeEncoding.$(OBJ_SUFFIX) \
$(OBJDIR)/ut_OverstrikingChars.$(OBJ_SUFFIX) \
$(OBJDIR)/ut_Language.$(OBJ_SUFFIX) \
- $(OBJDIR)/ut_Encoding.$(OBJ_SUFFIX)
+ $(OBJDIR)/ut_Encoding.$(OBJ_SUFFIX) \
+ $(OBJDIR)/ut_path.$(OBJ_SUFFIX)
include $(ABI_ROOT)/src/config/abi_rules.mk
Index: abi/src/af/util/beos/Makefile
===================================================================
RCS file: /cvsroot/abi/src/af/util/beos/Makefile,v
retrieving revision 1.5
diff -u -3 -p -u -r1.5 Makefile
--- abi/src/af/util/beos/Makefile 1999/06/02 19:10:16 1.5
+++ abi/src/af/util/beos/Makefile 2001/08/17 00:57:17
@@ -27,7 +27,8 @@ CPPSRCS= ut_BeOSAssert.cpp \
ut_BeOSString.cpp \
ut_Rehydrate.cpp \
ut_Xpm2Bitmap.cpp \
- ut_debugmsg.cpp
+ ut_debugmsg.cpp \
+ ut_path.cpp
TARGETS= $(OBJS)
Index: abi/src/af/util/mac/GNUmakefile.am
===================================================================
RCS file: /cvsroot/abi/src/af/util/mac/GNUmakefile.am,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 GNUmakefile.am
--- abi/src/af/util/mac/GNUmakefile.am 2001/04/24 22:30:33 1.3
+++ abi/src/af/util/mac/GNUmakefile.am 2001/08/17 00:57:17
@@ -30,5 +30,6 @@ libUtil_mac_a_SOURCES= \
ut_unixAssert.cpp \
ut_MacFiles.cpp \
ut_MacTimer.cpp \
- ut_debugmsg.cpp
+ ut_debugmsg.cpp \
+ ut_path.cpp
Index: abi/src/af/util/mac/Makefile
===================================================================
RCS file: /cvsroot/abi/src/af/util/mac/Makefile,v
retrieving revision 1.7
diff -u -3 -p -u -r1.7 Makefile
--- abi/src/af/util/mac/Makefile 2001/03/04 23:22:07 1.7
+++ abi/src/af/util/mac/Makefile 2001/08/17 00:57:17
@@ -30,7 +30,8 @@ CPPSRCS= ut_debugmsg.cpp \
ut_MacAssert.cpp \
ut_MacTimer.cpp \
ut_unixAssert.cpp \
- ut_Xpm2Bmp.cpp
+ ut_Xpm2Bmp.cpp \
+ ut_path.cpp
REZSRCS= ut_MacAssert.r
Index: abi/src/af/util/qnx/Makefile
===================================================================
RCS file: /cvsroot/abi/src/af/util/qnx/Makefile,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 Makefile
--- abi/src/af/util/qnx/Makefile 2000/03/07 12:33:15 1.2
+++ abi/src/af/util/qnx/Makefile 2001/08/17 00:57:17
@@ -27,7 +27,8 @@ CPPSRCS= ut_debugmsg.cpp \
ut_qnxString.cpp \
ut_Xpm2Bitmap.cpp \
ut_qnxHelper.cpp \
- ut_qnxTimer.cpp
+ ut_qnxTimer.cpp \
+ ut_path.cpp
TARGETS= $(OBJS)
Index: abi/src/af/util/unix/GNUmakefile.am
===================================================================
RCS file: /cvsroot/abi/src/af/util/unix/GNUmakefile.am,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 GNUmakefile.am
--- abi/src/af/util/unix/GNUmakefile.am 2001/04/15 08:38:46 1.3
+++ abi/src/af/util/unix/GNUmakefile.am 2001/08/17 00:57:17
@@ -28,4 +28,5 @@ libUtil_unix_a_SOURCES=\
ut_unixAssert.cpp \
ut_unixString.cpp \
ut_unixTimer.cpp \
- ut_dialogHelper.cpp
+ ut_dialogHelper.cpp \
+ ut_path.cpp
Index: abi/src/af/util/unix/Makefile
===================================================================
RCS file: /cvsroot/abi/src/af/util/unix/Makefile,v
retrieving revision 1.12
diff -u -3 -p -u -r1.12 Makefile
--- abi/src/af/util/unix/Makefile 2001/03/27 16:28:39 1.12
+++ abi/src/af/util/unix/Makefile 2001/08/17 00:57:17
@@ -27,7 +27,8 @@ CPPSRCS= ut_debugmsg.cpp \
ut_unixString.cpp \
ut_unixTimer.cpp \
ut_dialogHelper.cpp \
- ut_files.cpp
+ ut_files.cpp \
+ ut_path.cpp
TARGETS= $(OBJS)
Index: abi/src/af/util/win/Makefile
===================================================================
RCS file: /cvsroot/abi/src/af/util/win/Makefile,v
retrieving revision 1.17
diff -u -3 -p -u -r1.17 Makefile
--- abi/src/af/util/win/Makefile 2001/08/10 18:32:38 1.17
+++ abi/src/af/util/win/Makefile 2001/08/17 00:57:17
@@ -28,7 +28,8 @@ CPPSRCS= ut_debugmsg.cpp \
ut_Win32Timer.cpp \
ut_Win32Locale.cpp \
ut_Xpm2Bmp.cpp \
- ut_sleep.cpp
+ ut_sleep.cpp \
+ ut_path.cpp
INCLUDES= -I$(ABI_XX_ROOT)/../libiconv/include
Index: abi/src/wp/impexp/xp/ie_exp_HTML.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_exp_HTML.cpp,v
retrieving revision 1.88
diff -u -3 -p -u -r1.88 ie_exp_HTML.cpp
--- abi/src/wp/impexp/xp/ie_exp_HTML.cpp 2001/08/01 14:27:10 1.88
+++ abi/src/wp/impexp/xp/ie_exp_HTML.cpp 2001/08/17 00:57:18
@@ -18,6 +18,10 @@
*/
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
@@ -29,6 +33,7 @@
#include "ut_hash.h"
#include "ut_units.h"
#include "ut_wctomb.h"
+#include "ut_path.h"
#include "pt_Types.h"
#include "fd_Field.h"
#include "ie_exp_HTML.h"
@@ -262,6 +267,7 @@ protected:
UT_uint16 m_iListDepth; // 0 corresponds to not in a list
UT_uint16 m_iPrevListDepth;
UT_Stack m_utsListType;
+ UT_Vector m_utvDataIDs; // list of data ids for image
+enumeration
UT_uint16 m_iImgCnt;
UT_Wctomb m_wmctomb;
};
@@ -342,7 +348,7 @@ void s_HTML_Listener::_closeTag(void)
{
if(!m_bWroteText)
{
- m_pie->write("<br />\r\n");
+ m_pie->write("<br />");
}
m_pie->write("</p>\r\n");
}
@@ -402,11 +408,11 @@ void s_HTML_Listener::_openTag(PT_AttrPr
if (
(pAP->getAttribute("style", szValue) ||
- pAP->getAttribute("listid", szListID))
+ (pAP->getAttribute("listid", szListID) &&
+ 0 != UT_strcmp(szListID, "0")))
)
{
- if(pAP->getAttribute("listid", szListID) &&
- 0 != UT_strcmp(szListID, "0"))
+ if(pAP->getAttribute("listid", szListID))
{ // we're in a list
if(!pAP->getAttribute("style", szValue)) szValue =
szDefault;
pAP->getAttribute("level", szLevel);
@@ -1288,17 +1294,17 @@ void s_HTML_Listener::_outputData(const
case '\t':
// try to honor multiple spaces
- if(m_bNextIsSpace)
- {
+ if(m_bNextIsSpace)
+ {
sBuf += " ";
pData++;
- }
- else
- {
+ }
+ else
+ {
sBuf += *pData;
pData++;
- }
- break;
+ }
+ break;
case UCS_LF: // LF -- representing a
Forced-Line-Break
sBuf += "<br />";
@@ -1311,6 +1317,32 @@ void s_HTML_Listener::_outputData(const
break; // TODO: This
handles apostrophes
//
(smart single right quotes)
//
what about the other types?
+ case UCS_LQUOTE:
+ sBuf += "\'";
+ pData++;
+ break;
+
+ case UCS_RDBLQUOTE:
+ sBuf += "”";
+ pData++;
+ break;
+
+ case UCS_LDBLQUOTE:
+ sBuf += "“";
+ pData++;
+ break;
+
+ case UCS_EN_DASH:
+ case UCS_EM_DASH:
+ sBuf += "-";
+ pData++;
+ break;
+
+ case UCS_FF: // page break, convert
+to line break
+ sBuf += "<br />";
+ pData++;
+ break;
+
default:
if (*pData > 0x007f)
{
@@ -1646,7 +1678,9 @@ s_HTML_Listener::~s_HTML_Listener()
{
DELETEP(popped);
}
-
+
+ UT_VECTOR_PURGEALL(char*, m_utvDataIDs);
+
m_pie->write("</body>\r\n");
m_pie->write("</html>\r\n");
}
@@ -1693,13 +1727,23 @@ bool s_HTML_Listener::populate(PL_StruxF
case PTO_Image:
// TODO: differentiate between SVG and PNG
// TODO: we do this in the img saving code
- sprintf(buf, "-%d.png", m_iImgCnt++);
- m_pie->write("<img alt=\"AbiWord Image");
- m_pie->write(buf);
- m_pie->write("\" src=\"");
- m_pie->write(m_pie->getFileName());
- m_pie->write(buf);
- m_pie->write("\" />\r\n");
+
+ if(bHaveProp && pAP && pAP->getAttribute("dataid",
+szValue))
+ {
+ char* dataid = new char[strlen((char*)
+szValue)];
+ strcpy(dataid, (char*) szValue);
+
+ m_utvDataIDs.push_back(dataid);
+
+ sprintf(buf, "%d.png", m_iImgCnt++);
+ m_pie->write("<img alt=\"AbiWord Image");
+ m_pie->write(buf);
+ m_pie->write("\" src=\"");
+ m_pie->write(basename(m_pie->getFileName()));
+ m_pie->write("_d/");
+ m_pie->write(buf);
+ m_pie->write("\" />\r\n");
+ }
return true;
case PTO_Field:
@@ -1876,32 +1920,48 @@ void s_HTML_Listener::_handleDataItems(v
const UT_ByteBuf * pByteBuf;
for (UT_uint32 k=0;
(m_pDocument->enumDataItems(k,NULL,&szName,&pByteBuf,(void**)&szMimeType)); k++)
- {
- FILE *fp;
- char fname [1024]; // EVIL EVIL bad hardcoded buffer size
-
- if (!UT_strcmp(szMimeType, "image/svg-xml"))
- sprintf(fname, "%s-%d.svg", m_pie->getFileName(), k);
- if (!UT_strcmp(szMimeType, "text/mathml"))
- sprintf(fname, "%s-%d.mathml", m_pie->getFileName(), k);
- else // PNG Image
- sprintf(fname, "%s-%d.png", m_pie->getFileName(), k);
-
- fp = fopen (fname, "wb+");
-
- if(!fp)
- continue;
-
- int cnt = 0, len = pByteBuf->getLength();
-
- while (cnt < len)
- {
- cnt += fwrite (pByteBuf->getPointer(cnt), sizeof(UT_Byte), len-cnt, fp);
- }
-
- fclose(fp);
+ {
+ UT_sint32 loc = -1;
+ for (UT_uint32 i = 0; i < m_utvDataIDs.getItemCount(); i++)
+ {
+ if(UT_strcmp((char*) m_utvDataIDs[i], szName) == 0)
+ {
+ loc = i;
+ break;
+ }
+ }
+
+ if(loc > -1)
+ {
+ FILE *fp;
+ char fname [1024]; // EVIL EVIL bad hardcoded buffer size
+
+ sprintf(fname, "%s_d", m_pie->getFileName());
+ int result = mkdir(fname, 0750);
+
+ if (!UT_strcmp(szMimeType, "image/svg-xml"))
+ sprintf(fname, "%s/%d.svg", fname, loc);
+ if (!UT_strcmp(szMimeType, "text/mathml"))
+ sprintf(fname, "%s/%d.mathml", fname, loc);
+ else // PNG Image
+ sprintf(fname, "%s/%d.png", fname, loc);
+
+ fp = fopen (fname, "wb+");
+
+ if(!fp)
+ continue;
+
+ int cnt = 0, len = pByteBuf->getLength();
+
+ while (cnt < len)
+ {
+ cnt += fwrite (pByteBuf->getPointer(cnt),
+ sizeof(UT_Byte), len-cnt, fp);
+ }
+
+ fclose(fp);
+ }
}
return;
}
-
Index: abi/src/wp/impexp/xp/ie_imp_XHTML.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/impexp/xp/ie_imp_XHTML.cpp,v
retrieving revision 1.24
diff -u -3 -p -u -r1.24 ie_imp_XHTML.cpp
--- abi/src/wp/impexp/xp/ie_imp_XHTML.cpp 2001/08/01 07:57:25 1.24
+++ abi/src/wp/impexp/xp/ie_imp_XHTML.cpp 2001/08/17 00:57:18
@@ -180,7 +180,7 @@ bool IE_Imp_XHTML_Sniffer::getDlgLabels(
"level", "1",
"listid", "1",
"parentid", "0",
- "props", "list-style:Numbered List; color:000000; font-family:Times New Roman;
font-size:12pt; font-style:normal; font-weight:normal; start-value:1;
text-decoration:none; text-indent:-0.3in; text-position:normal;",
+ "props", "list-style:Numbered List; color:000000; font-family:Times New Roman;
+font-size:12pt; font-style:normal; font-weight:normal; start-value:1;
+text-decoration:none; text-indent:-0.3in; text-position:normal; field-font: NULL;",
/* margin-left is purposefully left out of the props. It is computed
based on the depth of the list, and appended to this list of
attributes. */
@@ -203,7 +203,7 @@ bool IE_Imp_XHTML_Sniffer::getDlgLabels(
"level", "1",
"listid", "2",
"parentid", "0",
- "props", "list-style:Bullet List;color:000000; font-family:Times New Roman;
font-size:12pt; font-style:normal; font-weight:normal; start-value:0;
text-decoration:none; text-indent:-0.3in; text-position:normal;",
+ "props", "list-style:Bullet List;color:000000; font-family:Times New Roman;
+font-size:12pt; font-style:normal; font-weight:normal; start-value:0;
+text-decoration:none; text-indent:-0.3in; text-position:normal; field-font: Symbol;",
/* margin-left is purposefully left out of the props. It is computed
based on the depth of the list, and appended to this list of
attributes. */