diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 969eac1f7..8d3478579 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -714,7 +714,12 @@ namespace NLGUI std::vector _CellParams; // Indentation - uint _Indent; + std::vector _Indent; + inline uint getIndent() const { + if (_Indent.empty()) + return 0; + return _Indent.back(); + } // Current node is a title bool _Title; diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index 65a0fcaff..cd82417d6 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -94,6 +94,7 @@ namespace NLGUI _XReal = _YReal = _WReal = _HReal = 0; _X = _Y = _W = _H = 0; //_Snap = 1; + _MarginLeft = 0; _PosRef = Hotspot_BL; _ParentPosRef = Hotspot_BL; @@ -178,6 +179,9 @@ namespace NLGUI sint32 getH() const { return (_Active?_H:0); } sint32 getH(bool bTestActive) const { return (bTestActive?(_Active?_H:0):_H); } + void setMarginLeft(sint32 m) { _MarginLeft = m; } + sint32 getMarginLeft() const { return _MarginLeft; } + /** * Get the max width used by the window. * @@ -568,6 +572,8 @@ namespace NLGUI sint32 _W; sint32 _H; + sint32 _MarginLeft; + //sint32 _Snap; // position references e.g. : _PosRef=BL, _ParentPosref=MM : the bottom left corner of the element diff --git a/code/nel/include/nel/gui/view_text.h b/code/nel/include/nel/gui/view_text.h index a00932667..8b8e1a7cf 100644 --- a/code/nel/include/nel/gui/view_text.h +++ b/code/nel/include/nel/gui/view_text.h @@ -93,7 +93,7 @@ namespace NLGUI void setMultiLineSpace (sint nMultiLineSpace); void setMultiLineMaxWOnly (bool state); void setMultiLineClipEndSpace (bool state); // use it for multiline edit box for instance - void setFirstLineX (uint firstLineX); + void setFirstLineX (sint firstLineX); void setMultiMaxLine(uint l) { _MultiMaxLine = l; } void setMultiMinLine(uint l) { _MultiMinLine = l; } @@ -398,7 +398,7 @@ namespace NLGUI uint _TextSelectionEnd; // First line X coordinate - uint _FirstLineX; + sint _FirstLineX; /// Dynamic tooltips std::vector _Tooltips; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index ab5644f9d..b185c67c3 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -225,8 +225,6 @@ namespace NLGUI btn->setTexturePushed(file); btn->invalidateCoords(); btn->invalidateContent(); - btn->resetInvalidCoords(); - btn->updateCoords(); paragraphChange(); } else @@ -242,8 +240,6 @@ namespace NLGUI btm->setTexture (file); btm->invalidateCoords(); btm->invalidateContent(); - btm->resetInvalidCoords(); - btm->updateCoords(); paragraphChange(); } else @@ -254,14 +250,12 @@ namespace NLGUI btgc->setTexture (file); btgc->invalidateCoords(); btgc->invalidateContent(); - btgc->resetInvalidCoords(); - btgc->updateCoords(); paragraphChange(); } } } } - + // Force image width, height void CGroupHTML::setImageSize(CViewBase *view, const CStyleParams &style) { @@ -2181,8 +2175,9 @@ namespace NLGUI sint32 indent = LIIndent; // list-style-type: outside if (_CurrentViewLink) - indent -= _CurrentViewLink->getMaxUsedW(); - getParagraph()->setFirstViewIndent(indent); + { + getParagraph()->setFirstViewIndent(-_CurrentViewLink->getMaxUsedW()); + } flushString (); @@ -2238,8 +2233,7 @@ namespace NLGUI if (present[MY_HTML_TABLE_CELLPADDING] && value[MY_HTML_TABLE_CELLPADDING]) fromString(value[MY_HTML_TABLE_CELLPADDING], table->CellPadding); - // Table must fit the container size - + table->setMarginLeft(getIndent()); addHtmlGroup (table, 0); _Tables.push_back(table); @@ -2247,6 +2241,7 @@ namespace NLGUI // Add a cell pointer _Cells.push_back(NULL); _TR.push_back(false); + _Indent.push_back(0); } break; case HTML_TH: @@ -2328,7 +2323,12 @@ namespace NLGUI _Cells.back()->NewLine = getTR(); table->addChild (_Cells.back()); + + // reusing indent pushed by table + _Indent.back() = 0; + newParagraph(TDBeginSpace); + // indent is already 0, getParagraph()->setMarginLeft(0); // maybe setIndent(0) if LI is using one // Reset TR flag if (!_TR.empty()) @@ -2418,7 +2418,7 @@ namespace NLGUI _UL.push_back(HTMLOListElement(1, "square")); // if LI is already present _LI = _UL.size() > 1 || _DL.size() > 1; - _Indent += ULIndent; + _Indent.push_back(getIndent() + ULIndent); endParagraph(); break; case HTML_OBJECT: @@ -2489,6 +2489,13 @@ namespace NLGUI case HTML_DT: if (!_DL.empty()) { + // close DT if still open + if (_DL.back().DD) + { + _DL.back().DD = false; + popIfNotEmpty(_Indent); + } + // see if this is the first
, closing tag not required if (!_DL.back().DT) { @@ -2519,8 +2526,8 @@ namespace NLGUI if (!_DL.back().DD) { - _Indent += ULIndent; _DL.back().DD = true; + _Indent.push_back(getIndent() + ULIndent); } if (!_LI) @@ -2547,7 +2554,7 @@ namespace NLGUI _UL.push_back(HTMLOListElement(start, type)); // if LI is already present _LI = _UL.size() > 1 || _DL.size() > 1; - _Indent += ULIndent; + _Indent.push_back(getIndent() + ULIndent); endParagraph(); } break; @@ -2659,6 +2666,7 @@ namespace NLGUI popIfNotEmpty (_TR); popIfNotEmpty (_Cells); popIfNotEmpty (_Tables); + popIfNotEmpty (_Indent); endParagraph(); // Add a cell break; @@ -2801,13 +2809,9 @@ namespace NLGUI case HTML_UL: if (!_UL.empty()) { - if (_Indent > ULIndent) - _Indent = _Indent - ULIndent; - else - _Indent = 0; - endParagraph(); popIfNotEmpty(_UL); + popIfNotEmpty(_Indent); } break; case HTML_DL: @@ -2824,10 +2828,7 @@ namespace NLGUI // unclosed DD if (_DL.back().DD) { - if (_Indent > ULIndent) - _Indent = _Indent - ULIndent; - else - _Indent = 0; + popIfNotEmpty(_Indent); } popIfNotEmpty (_DL); @@ -2846,12 +2847,8 @@ namespace NLGUI // parser will process two DD in a row as nested when first DD is not closed if (_DL.back().DD) { - if (_Indent > ULIndent) - _Indent = _Indent - ULIndent; - else - _Indent = 0; - _DL.back().DD = false; + popIfNotEmpty(_Indent); } } break; @@ -2964,7 +2961,7 @@ namespace NLGUI _Connecting = false; _CurrentViewLink = NULL; _CurrentViewImage = NULL; - _Indent = 0; + _Indent.clear(); _LI = false; _SelectOption = false; _GroupListAdaptor = NULL; @@ -4033,7 +4030,7 @@ namespace NLGUI CGroupParagraph *newParagraph = new CGroupParagraph(CViewBase::TCtorParam()); newParagraph->setResizeFromChildH(true); - newParagraph->setIndent(_Indent); + newParagraph->setMarginLeft(getIndent()); // Add to the group addHtmlGroup (newParagraph, beginSpace); @@ -4767,7 +4764,7 @@ namespace NLGUI _FontOblique.clear(); _FontUnderlined.clear(); _FontStrikeThrough.clear(); - _Indent = 0; + _Indent.clear(); _LI = false; _UL.clear(); _DL.clear(); diff --git a/code/nel/src/gui/interface_element.cpp b/code/nel/src/gui/interface_element.cpp index e33d1dbd8..2e13d80e6 100644 --- a/code/nel/src/gui/interface_element.cpp +++ b/code/nel/src/gui/interface_element.cpp @@ -509,7 +509,7 @@ namespace NLGUI // ------------------------------------------------------------------------------------------------ void CInterfaceElement::updateCoords() { - _XReal = _X; + _XReal = _X + _MarginLeft; _YReal = _Y; _WReal = getW(); _HReal = getH(); @@ -526,7 +526,7 @@ namespace NLGUI if (el == NULL) return; - _XReal += el->_XReal; + _XReal += el->_XReal - el->_MarginLeft; _YReal += el->_YReal; THotSpot hsParent = _ParentPosRef; diff --git a/code/nel/src/gui/interface_group.cpp b/code/nel/src/gui/interface_group.cpp index fc75ae0db..dce9fc266 100644 --- a/code/nel/src/gui/interface_group.cpp +++ b/code/nel/src/gui/interface_group.cpp @@ -1457,7 +1457,7 @@ namespace NLGUI } CViewBase::updateCoords(); - _XReal += _OffsetX; + _XReal += _OffsetX + _MarginLeft; _YReal += _OffsetY; //update all children elements @@ -1468,7 +1468,7 @@ namespace NLGUI pIE->updateCoords(); } - _XReal -= _OffsetX; + _XReal -= _OffsetX - _MarginLeft; _YReal -= _OffsetY; } @@ -1958,9 +1958,9 @@ namespace NLGUI newSciH = newSciH - ((newSciY+newSciH)-(oldSciY+oldSciH)); } - newSciXDest = newSciX; + newSciXDest = newSciX - _MarginLeft; newSciYDest = newSciY; - newSciWDest = newSciW; + newSciWDest = newSciW + _MarginLeft; newSciHDest = newSciH; } diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index e145db91c..2faae3a0a 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -2494,7 +2494,7 @@ namespace NLGUI } // *************************************************************************** - void CViewText::setFirstLineX(uint firstLineX) + void CViewText::setFirstLineX(sint firstLineX) { _FirstLineX = firstLineX; } diff --git a/code/nel/tools/nel_unit_test/CMakeLists.txt b/code/nel/tools/nel_unit_test/CMakeLists.txt index 7e26a2498..6abc06a49 100644 --- a/code/nel/tools/nel_unit_test/CMakeLists.txt +++ b/code/nel/tools/nel_unit_test/CMakeLists.txt @@ -8,6 +8,6 @@ TARGET_LINK_LIBRARIES(nel_unit_test ${CPPTEST_LIBRARIES} nelmisc nelnet nelligo) NL_DEFAULT_PROPS(nel_unit_test "Unit Tests") NL_ADD_RUNTIME_FLAGS(nel_unit_test) -ADD_DEFINITIONS(-DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/tools/nel_unit_test/") +ADD_DEFINITIONS(-DNEL_UNIT_BASE="${PROJECT_SOURCE_DIR}/nel/tools/nel_unit_test/") INSTALL(TARGETS nel_unit_test RUNTIME DESTINATION ${NL_BIN_PREFIX}) diff --git a/code/nel/tools/nel_unit_test/__copy_file_dst.foo b/code/nel/tools/nel_unit_test/__copy_file_dst.foo deleted file mode 100644 index ab13f948a..000000000 Binary files a/code/nel/tools/nel_unit_test/__copy_file_dst.foo and /dev/null differ diff --git a/code/nel/tools/nel_unit_test/__ligo_class.xml b/code/nel/tools/nel_unit_test/__ligo_class.xml deleted file mode 100644 index ff2ff2ee0..000000000 --- a/code/nel/tools/nel_unit_test/__ligo_class.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/code/nel/tools/nel_unit_test/__test_prim.primitive b/code/nel/tools/nel_unit_test/__test_prim.primitive deleted file mode 100644 index 479734bcb..000000000 --- a/code/nel/tools/nel_unit_test/__test_prim.primitive +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - class - test - - - name - test_root - - - - - class - alias - - - name - alias - - - - - diff --git a/code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg b/code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg deleted file mode 100644 index 72c6bdf68..000000000 --- a/code/nel/tools/nel_unit_test/debug_cfg_with_error_main.cfg +++ /dev/null @@ -1,41 +0,0 @@ -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 1 -// This config file include the config file with error then generate an error -// WARNING : is you add lines, update the code in the test - - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 1 -// In this cfg, we introduce an error in a line after define and if clause - - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 5 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 7 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 9 - // nothing - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 13 -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error.cfg" 15 - - -// Here is the offending line, at line 18 -ABadVar iable = "foo"; - -// Some additionnal garbase lines - -AGoodVar = "bar"; -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 6 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 8 -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 9 - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 11 - // nothing - -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 15 -#fileline "r:/code/nel/tools/nel_unit_test/ut_misc_files/cfg_with_error_main.cfg" 17 - - -// Some additionnal garbase lines - -AGoodVar = "bar"; diff --git a/code/nel/tools/nel_unit_test/result.html b/code/nel/tools/nel_unit_test/result.html deleted file mode 100644 index 057425b9f..000000000 --- a/code/nel/tools/nel_unit_test/result.html +++ /dev/null @@ -1,820 +0,0 @@ - - - - - - - NeLTest Unit Tests Results - - - - - - -

NeLTest Unit Tests Results

- -
-Designed by CppTest -
-
- -

Summary

- - - - - - - - - - - - - -
TestsErrorsSuccessTime (s)
66198%35.265000
-
- -

Test suites

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTestsErrorsSuccessTime (s)
CUTMiscCoTask20100%0.000000
CUTMiscCommand50100%0.015000
CUTMiscConfigFile60100%0.032000
CUTMiscDebug20100%0.000000
CUTMiscDynLibLoad 10100%0.000000
CUTMiscFile40100%0.859000
CUTMiscPackFile110100%0.016000
CUTMiscSingleton20100%0.000000
CUTMiscSString10100%0.000000
CUTMiscStream40100%0.000000
CUTMiscVariable 10100%0.000000
CUTMiscTypes110%0.000000
CUTNetLayer310100%2.312000
CUTNetMessage30100%0.000000
CUTNetModule210100%32.031000
CUTLigoPrimitive10100%0.000000
-
- -

Suite: CUTMiscCoTask

- - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
runTasks0true0.000000
tasksAndThreads0true0.000000
-

Back to top -

-

Suite: CUTMiscCommand

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
createOneInstance0true0.015000
createAnotherInstance0true0.000000
deleteOneInstance0true0.000000
derivedClass0true0.000000
derivedClassAndBaseCall0true0.000000
-

Back to top -

-

Suite: CUTMiscConfigFile

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
configWithInclude0true0.016000
configWithOptional0true0.000000
configWithDefine0true0.000000
configWithBadTest0true0.000000
configIncludeAndOptional0true0.000000
reportErrorInSubFiles0true0.016000
-

Back to top -

-

Suite: CUTMiscDebug

- - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testInstanceCounter0true0.000000
testInstanceCounterOutput0true0.000000
-

Back to top -

-

Suite: CUTMiscDynLibLoad

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
libraryNameDecoration0true0.000000
-

Back to top -

-

Suite: CUTMiscFile

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
copyOneBigFile0true0.187000
copyDifferentFileSize0true0.203000
moveOneBigFile0true0.203000
moveDifferentFileSize0true0.266000
-

Back to top -

-

Suite: CUTMiscPackFile

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
addBnp0true0.000000
loadFromBnp0true0.000000
addXmlpack0true0.016000
loadFromXmlpack0true0.000000
compressMemory0true0.000000
loadFromBnpCompressed0true0.000000
loadFromXmlpackCompressed0true0.000000
decompressMemory0true0.000000
loadFromBnpUncompressed0true0.000000
loadFromXmlpackUncompressed0true0.000000
loadXmlpackWithSameName0true0.000000
-

Back to top -

-

Suite: CUTMiscSingleton

- - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
createSingleton0true0.000000
accessSingleton0true0.000000
-

Back to top -

-

Suite: CUTMiscSString

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testStrtok0true0.000000
-

Back to top -

-

Suite: CUTMiscStream

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
constAndStream0true0.000000
memStreamSwap0true0.000000
copyOnWrite0true0.000000
preallocatedBitStream0true0.000000
-

Back to top -

-

Suite: CUTMiscVariable

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
declareVar0true0.000000
-

Back to top -

-

Suite: CUTMiscTypes

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
basicTypes1false0.000000
-

Back to top -

-

Suite: CUTNetLayer3

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
sendReceiveUpdate0true2.312000
-

Back to top -

-

Suite: CUTNetMessage

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
messageSwap0true0.000000
lockSubMEssage0true0.000000
lockSubMEssageWithLongName0true0.000000
-

Back to top -

-

Suite: CUTNetModule

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testModuleInitInfoParsing0true0.000000
testModuleInitInfoQuering0true0.000000
testModuleInitInfoBadParsing0true0.000000
localModuleFactory0true0.016000
failedInit0true0.000000
createLocalGateway0true0.000000
plugLocalGateway0true0.000000
gatewayTransportManagement0true1.219000
connectGateways0true0.828000
moduleDisclosure0true1.328000
moduleMessaging0true1.625000
localMessageQueing0true0.609000
uniqueNameGenerator0true0.000000
gwPlugUnplug0true0.000000
peerInvisible0true3.453000
firewalling0true3.438000
distanceAndConnectionLoop0true6.109000
securityPlugin0true5.094000
synchronousMessaging0true1.031000
layer3Autoconnect0true6.672000
interceptorTest0true0.609000
-

Back to top -

-

Suite: CUTLigoPrimitive

- - - - - - - - - - - - - -
NameErrorsSuccessTime (s)
testAliasGenerator0true0.000000
-

Back to top -

-
- -

Test results

-

CUTMiscTypes::basicTypes

- - - - - - - - - - - - - -
TestCUTMiscTypes::basicTypes
Filed:\ryzom\nel\tools\nel_unit_test\ut_misc_types.h:31
Messagesizeof(time_t) == sizeof(uint32)
-

Back to CUTMiscTypes -

-
- - -

- - Valid XHTML 1.0 Strict - -

- -