[fixed] leader line disappears when reopening document

Discussions about the development of the TechDraw workbench
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: leader line disappears when reopening document

Postby uwestoehr » Mon Jan 13, 2020 12:05 am

wandererfan wrote:
Sun Jan 12, 2020 11:44 pm
Thanks to @wmayer's hints, this should be fixed by git commit 00c69a9c64.
Many thanks!
It is not completely fixed, because the line is now shown, but without its color. It has a red color and when reopening the document the line is shown in black.
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: leader line disappears when reopening document

Postby uwestoehr » Mon Jan 13, 2020 12:08 am

wandererfan wrote:
Thu Jan 09, 2020 12:48 am
All those "Draw" prefixes are a legacy of when TechDraw was Drawing v2.0.
I wanted to make a PR but cannot find where in the code the name is defined. Do you have a pointer for me?
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: leader line disappears when reopening document

Postby wandererfan » Mon Jan 13, 2020 1:46 am

uwestoehr wrote:
Mon Jan 13, 2020 12:08 am
I wanted to make a PR but cannot find where in the code the name is defined. Do you have a pointer for me?
This one is in TaskLeaderLine.cpp. For others, look for "getUniqueObjectName("Draw*"

Code: Select all

void TaskLeaderLine::createLeaderFeature(std::vector<Base::Vector3d> converted)
{
//    Base::Console().Message("TTL::createLeaderFeature()\n");
    m_leaderName = m_basePage->getDocument()->getUniqueObjectName("DrawLeaderLine");
    m_leaderType = "TechDraw::DrawLeaderLine";

    std::string PageName = m_basePage->getNameInDocument();

    Gui::Command::openCommand("Create Leader");
    Command::doCommand(Command::Doc,"App.activeDocument().addObject('%s','%s')",
                       m_leaderType.c_str(),m_leaderName.c_str());
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: leader line disappears when reopening document

Postby wandererfan » Mon Jan 13, 2020 1:49 am

uwestoehr wrote:
Mon Jan 13, 2020 12:05 am
It is not completely fixed, because the line is now shown, but without its color. It has a red color and when reopening the document the line is shown in black.
Ok, I'll look at it tomorrow.
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: leader line disappears when reopening document

Postby uwestoehr » Mon Jan 13, 2020 10:45 pm

wandererfan wrote:
Mon Jan 13, 2020 1:46 am
For others, look for "getUniqueObjectName("Draw*"
Many thanks. In fact it was really that easy: https://github.com/FreeCAD/FreeCAD/pull/2894

I tested it after the renaming and don't see any drawbacks so far.
User avatar
wandererfan
Posts: 3636
Joined: Tue Nov 06, 2012 5:42 pm

Re: leader line disappears when reopening document

Postby wandererfan » Tue Jan 14, 2020 12:32 pm

uwestoehr wrote:
Mon Jan 13, 2020 12:05 am
It is not completely fixed, because the line is now shown, but without its color. It has a red color and when reopening the document the line is shown in black.
Colors & styles should be fixed by git commit d64d6a7c65
User avatar
uwestoehr
Posts: 1356
Joined: Sun Jan 27, 2019 3:21 am

Re: leader line disappears when reopening document

Postby uwestoehr » Tue Jan 14, 2020 1:56 pm

wandererfan wrote:
Tue Jan 14, 2020 12:32 pm
Colors & styles should be fixed by git commit d64d6a7c65
many thanks! Confirmed that this is now fixed.