Beiträge von genicore

    WPTools 6.13


    This works as expected:

    Code
    TParagraph* p(...);p->TabstopAdd(WPCentimeterToTwips(3), tkLeft, tkDots);p->Insert(0, "some\ttext", Cardinal(0));

    This will produce a tab but without dots or a "marker" in the ruler:

    Code
    TWPTextStyle* style(Editor->ParStyles()->AddStyle("tab-style"));
    style->TabstopAdd(WPCentimeterToTwips(3), tkLeft, tkDots);
    TParagraph* p(...);
    p->SetStyle("tab-style");
    p->Insert(0, "some\ttext", Cardinal(0));

    So, is this a bug or am I missing something?


    Regards
    patrik.nyborg(a)genicore.se[/code]

    Borland C++ 6 update 4
    WPTools 6.13

    When checking the possible breakpoints in WPRteDefs.pas, they usually* looks fine until reaching TWPCursorCharAttrInterface.EndUpdate (on line 31200-something) where they suddenly disappears only to reappear a few thousand lines later but this time a few lines out-of-sync with the source. I suspect that the problem is the enoumous size of the file (we have seen this problem before with large files) but I can't say for sure. Needless to say this makes it really really hard to understand why wptools behaves in a certain way when checking for errors. So, is this a known problem? Any suggestions how to solve this (upgrading from Borland C++ 6 is not an option)?

    *) sometimes all breakpoints in the whole file is out-of-sync with the source

    Regards
    patrik.nyborg(a)genicore.se

    Borland C++ 6 update 4

    When upgrading from 6.11.2 => 6.13 (and now to 6.13.1) I got bitten by "Fatal: File not found: XPMan.dcu... BUILD FAILED".

    Removing it from WpParBrd2.pas and commenting out {-$DEFINE NEWBORDER} in WPINC.INC fixes the build.

    Is this a required dependency in wptools starting from version 6.12?


    Regards
    patrik.nyborg(a)genicore.se

    WPTools version 6.13

    Assume the following code:

    Code
    TParagraph* createCell(TParagraph* aRow) {  TParagraph* cell(aRow->AppendNewCell(true));  cell->ASet(WPAT_BorderFlags, WPBRD_DRAW_Left + WPBRD_DRAW_Top + WPBRD_DRAW_Bottom + WPBRD_DRAW_Right);  return cell;}void test() {  TParagraph* table(Editor->FirstPar->AppendNewPar(false));  table->ParagraphType = wpIsTable;  TParagraph* row1(table->AppendNewRow(true));  TParagraph* cell11(createCell(row1));  TParagraph* cell12(createCell(row1));  TParagraph* row2(table->AppendNewRow(true));  TParagraph* cell21(createCell(row2));  TParagraph* cell22(createCell(row2));  Editor->EditOptionsEx = (TWPEditOptionsEx(Editor->EditOptionsEx) << wpKeepCellsWhenCombiningCells); // <insert code here>}

    Now if I do the following at the end of the test function:

    Code
    Editor->SelectCell(cell11, false);  Editor->SelectCell(cell21, true);  Editor->CombineCellsVertHorz();

    I get the following table (note the double line):

    Code
    +-------+-------+|       |       |+       +=======+|       |       |+-------+-------+

    If I instead do the following at the end of the test function:

    Code
    Editor->SelectCell(cell12, false);  Editor->SelectCell(cell22, true);  Editor->CombineCellsVertHorz();

    I get the following table (note the missing line):

    Code
    +-------+-------+
    |       |       |
    +-------+       +
    |       |       |
    +-------+       +


    So, I'm misusing something or is there a bug in wptools?


    Regards
    patrik.nyborg(a)genicore.se

    Zitat von wpsupport


    output on the "Canvas" of the TWPRichText will also print if the printer supoports this.

    Hmmm yes, created a small testapplication which only outputs a rotated text directly to the printer canvas with the same result, so this has nothing to with wptools...

    Sorry for the inconvenience!


    Regards
    patrik.nyborg(a)genicore.se

    The following works fine in the editor, but the rotation is lost when printing; is there something that needs to be tweaked to get it to work?


    patrik.nyborg(a)genicore.se

    WPTools version 6.11.2

    This might be trivial but I'm a complete beginner when comes to wptools programming, so bear with me...

    We have a document containing protected and unprotected paragraphs. Some of these protected paragraphs contains (besides protected text and other stuff) one or more InputEditFields. Some of these fields should be protected and some should not (and the protection mode can change during the lifetime of the document depending on the state of the model).


    So, what is the easiest way to set the protection mode of a InputEditField inside a protected paragraph?


    Regards
    patrik.nyborg(a)genicore.se

    Sorry, should have included the RTF in the previous post:
    ------------------------------------------------------------
    {\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1053\deflangfe1053{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
    {\f64\froman\fcharset238\fprq2 Times New Roman CE;}{\f65\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f67\froman\fcharset161\fprq2 Times New Roman Greek;}{\f68\froman\fcharset162\fprq2 Times New Roman Tur;}
    {\f69\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f70\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f71\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f72\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
    {\f74\fswiss\fcharset238\fprq2 Arial CE;}{\f75\fswiss\fcharset204\fprq2 Arial Cyr;}{\f77\fswiss\fcharset161\fprq2 Arial Greek;}{\f78\fswiss\fcharset162\fprq2 Arial Tur;}{\f79\fswiss\fcharset177\fprq2 Arial (Hebrew);}
    {\f80\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f81\fswiss\fcharset186\fprq2 Arial Baltic;}{\f82\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
    \red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
    \red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 \snext0 \styrsid1977657 Normal;}{\s1\ql \fi-1418\li1418\ri0\sb240\keepn\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\outlinelevel0\adjustright\rin0\lin1418\itap0 \b\f1\fs22\lang1053\langfe1053\kerning32\cgrid\langnp1053\langfenp1053 \sbasedon0 \snext0 \styrsid1977657 heading 1;}{\s2\ql \fi-1418\li1418\ri0\sa60\keepn\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\ilvl1\outlinelevel1\adjustright\rin0\lin1418\itap0 \b\f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 \sbasedon0 \snext0 \styrsid1977657 heading 2;}{\s3\ql \fi-1418\li1418\ri0\sa60\keepn\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\ilvl2\outlinelevel2\adjustright\rin0\lin1418\itap0 \b\f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 \sbasedon0 \snext0 \styrsid1977657 heading 3;}{\s4\ql \fi-1418\li1418\ri0\sa60\keepn\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\ilvl3\outlinelevel3\adjustright\rin0\lin1418\itap0 \b\f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 \sbasedon0 \snext0 \styrsid1977657 heading 4;}{\s5\ql \fi-1418\li1418\ri0\sa60\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\ilvl4\outlinelevel4\adjustright\rin0\lin1418\itap0 \b\f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 \sbasedon0 \snext0 \styrsid1977657 heading 5;}{\s6\ql \fi-1418\li1418\ri0\sa60\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\ilvl5\outlinelevel5\adjustright\rin0\lin1418\itap0 \b\f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 \sbasedon0 \snext0 \styrsid1977657 heading 6;}{\*\cs10 \additive \ssemihidden
    Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
    \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\*\cs15 \additive \b\f1\fs24\lang1053\langfe1053\langnp1053\langfenp1053
    \sbasedon10 \slink16 \slocked \styrsid1977657 NormalRubrik Char;}{\s16\ql \li0\ri0\sb240\sa240\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \b\f1\fs28\lang1053\langfe1053\cgrid\langnp1053\langfenp1053
    \sbasedon0 \snext0 \slink15 \styrsid1977657 NormalRubrik;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid-529389796{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
    {\leveltext\'01\'00;}{\levelnumbers\'01;}\fbias0 \s1\fi-1418\li1418\jclisttab\tx1418\lin1418 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\fbias0
    \s2\fi-1418\li1418\jclisttab\tx1418\lin1418 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\fbias0 \s3\fi-1418\li1418
    \jclisttab\tx1418\lin1418 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\fbias0 \s4\fi-1418\li1418\jclisttab\tx1418\lin1418 }
    {\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\fbias0 \s5\fi-1418\li1418\jclisttab\tx1418\lin1418 }{\listlevel\levelnfc0
    \levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\fbias0 \s6\fi-1418\li1418\jclisttab\tx1418\lin1418 }{\listlevel\levelnfc255
    \levelnfcn255\leveljc0\leveljcn0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext\'00;}{\levelnumbers;}\fbias0 \fi0\li0\lin0 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow2\levelstartat1\levelspace0\levelindent0
    {\leveltext\'00;}{\levelnumbers;}\fbias0 \fi0\li0\lin0 }{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow2\levelstartat1\levelspace0\levelindent0{\leveltext\'00;}{\levelnumbers;}\fbias0 \fi0\li0\lin0 }{\listname ;}\listid1481997872}}
    {\*\listoverridetable{\listoverride\listid1481997872\listoverridecount0\ls1}}{\*\rsidtbl \rsid294644\rsid933319\rsid1977657\rsid2966747\rsid8067056\rsid11089308\rsid12221479\rsid12337526\rsid16199049\rsid16454148}\margl1417\margr1417\margt1417\margb1417
    \deftab1304\widowctrl\ftnbj\aenddoc\hyphhotz425\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984\dghshow1\dgvshow1
    \jexpand\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct\asianbrkrule\rsidroot294644\newtblstyruls\nogrowautofit \fet0\sectd
    \linex0\endnhere\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4
    \pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}
    {\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\listtext\pard\plain\s1 \cs15\b\f1\fs28\kerning32\insrsid1977657\charrsid933319
    \hich\af1\dbch\af0\loch\f1 1\tab}\pard\plain \s1\ql \fi-1418\li1418\ri0\sb240\keepn\widctlpar\jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\outlinelevel0\adjustright\rin0\lin1418\itap0\pararsid1977657
    \b\f1\fs22\lang1053\langfe1053\kerning32\cgrid\langnp1053\langfenp1053 {\cs15\fs28\insrsid1977657\charrsid933319 Paragraf1}{\insrsid1977657 !
    \par {\listtext\pard\plain\s2 \b\f1\fs22\insrsid1977657 \hich\af1\dbch\af0\loch\f1 1.1\tab}}\pard\plain \s2\ql \fi-1418\li1418\ri0\sa60\keepn\widctlpar
    \jclisttab\tx1418\aspalpha\aspnum\faauto\ls1\ilvl1\outlinelevel1\adjustright\rin0\lin1418\itap0\pararsid1977657 \b\f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 {\insrsid1977657 Paragraf2
    \par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1977657 \f1\fs22\lang1053\langfe1053\cgrid\langnp1053\langfenp1053 {\insrsid1977657 Paragraf3}}
    ------------------------------------------------------------

    Our application uses both WPTools 5.x and Microsoft Word (2003 at the moment) to edit certain texts. In this particular case, Word is used for editing and WPTools is used inside the application to view the actual text.
    Whenever such a text is changed in Word, we use WPToolsRTFToANSI to store the ansi text for use by some external report tool. The problem is that the resulting string contains style format names (or whatever they are called in Word)

    If I create the following 3 paragraphs in Word and applies some format
    ----------------------------------------------------------------
    paragraph1 <-- with "header1" format
    paragraph2 <-- with "header2" format
    paragraph3 <-- with "header3" format
    ----------------------------------------------------------------
    and feeds the resulting RTF to WPToolsRTFToANSI gives
    ----------------------------------------------------------------
    heading 1; heading 2; heading 3; heading 4; heading 5; heading 6; NormalRubrik; 1 Paragraf1!
    1.1 Paragraf2
    Paragraf3
    ----------------------------------------------------------------
    So the question is - is RTFproduced from Word not supported, am I doing something wrong or is this a bug?

    (WPTools version 6.07 gives the same result btw).


    Regards
    patrik.nyborg(a)genicore.se

    Platform: Borland C++ 6
    I'm currently evaluating av upgrade of wptools from 5.x->6.07.
    Compiling the new version adds the following dependencies.
    ------------------------------------------------------------
    vclx60.bpl='__fastcall Filectrl::initialization()'
    vclx60.bpl='__fastcall Filectrl::Finalization()'
    vclx60.bpl='__fastcall Filectrl::ForceDirectories(const System::AnsiString)'
    ------------------------------------------------------------
    because FileCtrl is used in WPOBJ_Image.pas.
    But afaict the only thing used is ForceDirectories(Dir), which
    simply delegates to SysUtils.ForceDirectories(Dir).

    This might be a non-issue for most people, but we are trying hard
    to minimize any kind of dependencies in our projects...


    patrik.nyborg(a)genicore.se

    WPTools version 6.07

    Setting {.$DEFINE USEJPEG} in WPObj_Image.pas gives these compile-time errors:
    ----------------------------------------
    ...\WPObj_Image.pas(670) Error: Undeclared identifier: 'TJPEGImage'
    ...\WPObj_Image.pas(772) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(780) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(784) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(785) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(787) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(792) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(807) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(811) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(1253) Error: Undeclared identifier: 'TJPEGImage'
    ...\WPObj_Image.pas(1253) Error: Operator not applicable to this operand type
    ...\WPObj_Image.pas(1272) Error: 'THEN' expected but identifier 'Grayscale' found
    ...\WPObj_Image.pas(1335) Error: EXCEPT or FINALLY expected
    ...\WPObj_Image.pas(1336) Error: 'END' expected but 'ELSE' found
    ...\WPObj_Image.pas(1337) Error: Missing operator or semicolon
    ...\WPObj_Image.pas(1405) Error: 'END' expected but 'EXCEPT' found
    ...\WPObj_Image.pas(1408) Error: EXCEPT or FINALLY expected
    ...\WPObj_Image.pas(1410) Error: Statement expected but 'FUNCTION' found
    ...\WPIO.pas(31) Fatal: Could not compile used unit 'WPObj_Image.pas'
    ----------------------------------------

    Inserting {$DEFINE NOJPEGCOMPRESS} will remove some errors but not all.
    Is there something I'm missing?


    patrik.nyborg(a)genicore.se