Try as you might to keep them fresh, there's no gaurantee.
Instead, just treat them as weak references and search the
existing items for a pointer-value match.
This also allows us to remove some code which kept recycling
the search position back to the start ever time a replace
was done.
Fixes: lp:1559258
* https://bugs.launchpad.net/kicad/+bug/1559258
This fixes potential DRC false positive bugs that occur when inner layers
are removed from the board but the actual objects on contained on those
layers remain in the board.
Since Pcbnew does not handle odd number layers, this is not a perfect fix.
When the user chooses the front or back layer only options from the layer
setup dialog, objects on the copper layers will not be removed. This will
not cause the false positive issue described above.
Get rid of dialog OK and cancel button event handlers and use the proper
TranferData(To/From)Window for handling control data.
Add PCB_LAYER_COLLECTOR for collecting board objects by layer. Factor out
redundant [] operators into base PCB_COLLECTOR object.
Fixes lp:893950
https://bugs.launchpad.net/kicad/+bug/893950
* Only check for search cache update on close dialog event instead of every
update of the find/replace view which caused an infinite loop when replace
all was called.
* Check for dirty search cache for each find/replace event.
* Add code to save and restore last replace index on cache refresh.
* The SCH_COLLECTOR m_foundItems was being obsoleted after a pin name search.
If a library edit changed the found pin name, the cache still held the now
missing library pin and would segfault on next search due to the cache being
out of date.
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
* Fix replace bug to handle case sensitivity properly.
* Fix replace bug where the item index was getting updated incorrectly.
* Fix replace infinite loop bug on replace all.
* Make find/replace view update code a separate function.
* Rearrange find/replace trace string to add tracing to EDA_ITEM::Replace().
* Add IsComplexHierarchy method to SCH_SHEET_LIST for future find/replace
improvements.
* Force search when wrap past end of list option changes state.
* Fix SCH_FIELD::Matches() for bug in user defined fields which have an ID
of -1.
* Minor improvements to the find data names to improve source code readability.
* Tweak the NETLIST_READER code to allow for component footprint names that
are not found in any library to generate a warning instead of an error and
update the board accordingly.
* Don't display undo warning in netlist dialog when dry run option selected.
* Rename netlist_reader_common.cpp to netlist_reader.cpp
* Rename netlist_reader_firstformat.cpp to legacy_netlist_reader.cpp
* Rename netlist_reader_kicad.cpp to kicad_netlist_reader.cpp
* Remove cvpcb/read_write_cmpfile.cpp and move the single function it
contained into cvframe.cpp
* Remove cvpcb/loadcmp.cpp and move the single function it contained into
class_DisplayFootprintsFrame.cpp.
* Remove cvpcb/readschematicnetlist.cpp and move the single function it
contained into cvframe.cpp.
* Remove cvpcb/setvisu.cpp and move the few functions it contained into
the appropriate source file.
* Add check box and flag to ignore replacing the component reference
designator field.
* Fix a resizing bug when switching between the find and replace modes of
the find/replace dialog.
* Fix replace component reference designator field bug.
* Force rebuild of search list when schematic is modified and the replace
dialog is closed.
* Prevent finding the next item when the find/replace dialog is closed.
* Respect warp mouse pointer setting when closing find/replace dialog.
* Fix duplicate mnemonic control accelerator keys in find/replace dialog.
* Enable replace toolbar button and menu entry.
* Improve find replace logging granularity.
* Fix find and replace dialog control hiding and disabling.
* Minor improvements to the SCH_FIND_REPLACE_DATA object.
* Move find collector list iterator into the collector object.
* Add visibility override flag to EDA_ITEM to temporarily show items that
are hidden during find and replace.
* Replace Eeschema find code with a collector based implementation.
* Fixed a search bug when all subsequent searches of an item would ignore
the remaining valid child items when an item had more than one child
item that matched the search criteria.
* Add SCH_FIND_COLLECTOR class to find all items that meet the specified
search criteria.
* Add SCH_FIND_COLLECT0R_DATA to keep track of information for all matching
items.
* Use collector to iterate over the list of items that match the search
criteria rather than trying to start at the last matched item.
* Remove unused searching methods from sheet path and sheet path list
objects.
* Add replace and replace all functionality to Eeschema find dialog.
* Push matching methods down to EDA_ITEM class so they can be used by
other derived objects.
* Add method to EDA_ITEM to test if item supports replacing.
* Add flag to find/replace data to support replace feature.
* Disable wild card matching check box when dialog is in replace mode as
wild card replacement is not supported at this time.
* The usual Doxygen comment and coding policy fixes.
* Create command event handler for orienting schematic items and block.
* Remove redundant orient item and block command handler code and IDs.
* Remove redundant cancel current command event table entry.
* Remove unnecessary schematic bitmap object virtual functions.
* Set path when saving schematic sheet files to prevent assertion in
updated path and file write permission test function.
* Restore directory and file name write permission test function to it's
previous behavior to prevent unexpected save results.
* Add an assertion to verify the path is not empty to directory and file
write permission test function.
* Improve documentation for path and file write permission test function.
* Fix Doxygen link warnings.
* Correct all user strings and comments for the correct capitalization of
application names according to JP. They are KiCad, Pcbnew, CvPcb,
Eeschema, and GerbView.
* Add a note the the user interface policy about the correct capitalization.
* Add drag context menu entry for junctions that actually form a junction
with wires to EESchema.
* Add function to test for junctions to SCH_COLLECTOR class.
* Create annotate type and sort order enums to eliminate magic numbers
used in annotate code.
* Remove duplicate Doxygen comments from annotate.cpp and improve the
actual Doxygen comments in wxEeschemaStruct.h.
* Remove specialized edit reference, value, and foot print field methods
from SCH_FRAME object.
* Improve general field method to handle all field types as this was
essentially the same code used in the three methods removed.
* Updated the the hot key and context menu handlers to use the new field
edit method.
* Minor Doxygen comment warning fixes.
* Add item clarification context menu to EESchema when multiple unresolved
items are found at the current cross hair position.
* Add collector class SCH_COLLECTOR for supporting multiple item hit testing.
* Removed bit wise masked filtering from schematic item hit testing.
* Removed all old hit testing functions and methods scattered about the
EESchema source code.
* Move terminal point test function into SCH_SCREEN object.
* Fixed bug in terminal point test when terminating a bus to a label.
* Define the < operator for sorting schematic items.
* Add area calculation method to EDA_Rect item.
* Add method for returning an item's bitmap for menu display purposes.
* Add method for returning an item's menu text for menu display purposes.
* Changed EDA_ITEMS container from boost::ptr_vector to std::vector.
* Factor coordinate string conversion code from EDA_DRAW_FRAME to function
CoordinateToString().