Alex Shvartzkop
cb25c8620e
Performance optimizations for database libraries.
(cherry picked from commit e68df8e1d1 )
2 years ago
Jeff Young
196e05bc51
Borrow parts of simulator's separator-detection algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15248
2 years ago
Alex Shvartzkop
f48a248db4
EasyEDA Std: Handle HTML escape characters in text.
2 years ago
Alex Shvartzkop
9ed19192de
Improve editing values with {return} in text fields; Add hyperlink detection.
2 years ago
Marek Roszko
11de95778b
Unwrap the FROM_UTF8 macro in favor of direct function
The extern just gets annoying to try to export the func later. We also yeet TO_UTF8 to string_utils.h for parity.
2 years ago
Alex Shvartzkop
21ee65aa9c
ADDED: Importers for EasyEDA (JLCEDA) Standard / Professional.
2 years ago
jean-pierre charras
df11673f86
GetISO8601CurrentDateTime(): use %z format on msys2 build ucrt64
(however ucrt64 on msys2 has an issue (crash) with json validator and
can be used only for tests)
2 years ago
jean-pierre charras
0741471092
GetISO8601CurrentDateTime(): workaround on msys2 to fix a format issue.
on msys2 the format %z is seen as %Z, which is not acceptable here.
so %z format is removed on msys2
2 years ago
jean-pierre charras
0ecf5033e2
string_utils: Add From_UTF8( const char* cstring ) and From_UTF8( const std::string aString ),
mainly because we now use std::string in a lot of function using previously char*
FROM_UTF8(const char* cstring) now calls From_UTF8(const char* cstring)
2 years ago
Marek Roszko
76cef27014
Remove needless utf8 conversion due to sleepyness
2 years ago
Marek Roszko
3233bbe0ba
Make exported date time strings use ISO8601 format
Also rename the function to be explicit on its result format
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15185
2 years ago
Alex Shvartzkop
afe176abe2
Optimize PDF plot data size for property popups; fix unicode escape.
Adds a document-level action JSInit, which defines ShM function,
allowing more compact data representation. Also reduces whitespaces.
2 years ago
jean-pierre charras
1406341d2d
Fix a few doxygen errors (no actual code change)
3 years ago
Jeff Young
7e5fedef6a
Markup fixes.
1) allow escape sequences inside markup sequences
2) keep overbar when inside nested markup
3) always place overbar at full height, not sub/superscript height
Fixes https://gitlab.com/kicad/code/kicad/issues/14553
Fixes https://gitlab.com/kicad/code/kicad/issues/13449
3 years ago
Jeff Young
b74d964bff
Handle legacy libraries with escaped symbol names.
Fixes https://gitlab.com/kicad/code/kicad/issues/14057
3 years ago
jean-pierre charras
412368b7f9
PDF plotter: encode the letters ( and ) in strings with context CTX_JS_STR
They are separators and cannot be used in user strings.
Fixes #14302
https://gitlab.com/kicad/code/kicad/issues/14302
3 years ago
Marek Roszko
b2421c7d9f
Fix tiny bug in double 2 string formatting
- I forgot to handle the trailing dots when I added the fmt variant
- UIDouble2Str (the original) lacked the comma check
- Add unit test lol
3 years ago
Chris Morgan
2b128c79f2
sprintf -> snprintf to silence some compiler warnings
3 years ago
Jeff Young
76ce580bd0
Don't use KiCad escape sequences for JS text.
Fixes https://gitlab.com/kicad/code/kicad/issues/12782
3 years ago
Jeff Young
be142af4d0
Another attempt at string encoding for JS inside a PDF.
Fixes https://gitlab.com/kicad/code/kicad/issues/12782
3 years ago
jean-pierre charras
9dba54190e
PDF plotter: Encode '\' as "{backslash}" for CTX_JS_STR context.
This is a poor hack (similar to hack for the ' char), but it allows displaying
context menu when '\' is inserted in a property.
3 years ago
Marek Roszko
ece23d434b
Split up Double2Str to a format function to make its use case clear
3 years ago
Mark Roszko
75ae0d8e5e
Revert "Use {fmt} for double -> string conversions"
This reverts commit 03fff6e58d
3 years ago
Marek Roszko
03fff6e58d
Use {fmt} for double -> string conversions
Faster at printing floats than sprintf due to the modern algos
3 years ago
Jeff Young
d95847ae79
Add missing format specifier to UnescapeString.
Fixes https://gitlab.com/kicad/code/kicad/issues/9542
3 years ago
Jon Evans
b4e71de89f
LIB_IDs can have forward slashes
3 years ago
Jeff Young
8afc1db7a6
Property popups for symbols, labels, sheets, and footprints in PDF.
Fixes https://gitlab.com/kicad/code/kicad/issues/5521
3 years ago
Jeff Young
71724bea0c
Remove curly brace from string encoding.
It causes issues with formatting constructs and text variable refs,
and it's not a reserved character even in filenames.
Fixes https://gitlab.com/kicad/code/kicad/issues/12351
3 years ago
Marek Roszko
e4ba1d4879
Remove unused string helper
3 years ago
Jeff Young
582c133835
CSV escaping.
3 years ago
Jeff Young
3fddf0414b
A bit of wxT().
4 years ago
Jeff Young
a9eb7a0e28
Make sure LIB_ID escape context allows for formatting constructs.
Also make sure that value field is updated from name changes when the
symbol is a power symbol (even if it's from the schematic instead of
the library).
Fixes https://gitlab.com/kicad/code/kicad/issues/11093
4 years ago
Marek Roszko
2df80c6473
Add some more reserves for string funcs
4 years ago
Marek Roszko
ca5049b6bc
Try and reduce memory allocs when (un)escaping strings
4 years ago
Jeff Young
c6a8100d46
Schematic and symbol text boxes.
Also fixes some plot bugs with arcs.
Also moves polygonization of arcs (when required) in plotting code
from 5 degrees to calculated based on ARC_HIGH_DEF.
Fixes https://gitlab.com/kicad/code/kicad/issues/5017
4 years ago
dsa-t
bc1ff6756f
Cross-probing/selection for multiple items (SCH->PCB)
4 years ago
Jon Evans
0458afe20a
Fix escaping of double quotes in LIB_IDs
4 years ago
Jeff Young
59c15842f8
Exclude formatting chars from text width approximation.
Fixes https://gitlab.com/kicad/code/kicad/issues/9080
4 years ago
jean-pierre charras
4ac2aa675a
lib symbols: make fp filter tolerant to spaces in names.
For historical reasons they are stored in a string using spaces as separators.
So each fp filter is now escaped to remove spaces (replaced by {space})
Fixes #9009
https://gitlab.com/kicad/code/kicad/issues/9009
4 years ago
Jeff Young
6aaf4413b3
Fix kicad_string.h / string.cpp mismatch.
They don't define a KiCad string class, so the header file name was
somewhat misleading. But the fact that they didn't match definitely
made coding more difficult.
4 years ago
Wayne Stambaugh
37b200cb3e
Pass wxString objects by reference instead of on the stack.
4 years ago
Wayne Stambaugh
bcd6bddfd4
Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
4 years ago
luz paz
0446d35f0d
Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
5 years ago
Jeff Young
b1b4caee6a
Escape "naughty" characters in symbol names.
It's tempting to say that we don't need to exclude filename chars
from symbols, but we might regret that decision down the road. Better
to just escape them.
Fixes https://gitlab.com/kicad/code/kicad/issues/8694
5 years ago
Marek Roszko
ff2190630e
Optimize UnescapeString slightly to avoid repeated wxString::at calls
5 years ago
Jeff Young
5a43392eae
Protect against double overbar format conversion.
5 years ago
Mikolaj Wielgus
2a3d8e22b6
Do not create overbar from "~~" when converting to new format
Fixes bug 4 from https://gitlab.com/kicad/code/kicad/-/issues/8591 .
5 years ago
Mikolaj Wielgus
9a42ec753f
Recognize ' ', '}', ')' as terminators of overbar in conversion
Fixes bug 3 in https://gitlab.com/kicad/code/kicad/-/issues/8591 .
5 years ago
Jeff Young
d044e6fed3
Don't try and convert legacy empty-string tokens to overbar syntax.
5 years ago
Mikolaj Wielgus
ade38f48bc
Add conversion from old `~...~` to new `~{...}` notation
5 years ago